Skip to content

Commit 606cf95

Browse files
committed
Trying to get relative offsets working on IE 8
1 parent 99d60af commit 606cf95

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

Jakefile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@
222222
expect: false,
223223
dump: false,
224224
beforeEach: false,
225-
afterEach: false
225+
afterEach: false,
226+
227+
// Browser
228+
console: false
226229
};
227230
}
228231

src/client/_html_element_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
htmlElement.doMouseDown(0, 0);
7373
});
7474

75-
it("converts page coordinates into relative element coordinates", function() {
75+
it.only("converts page coordinates into relative element coordinates", function() {
7676
try {
7777
htmlElement.appendSelfToBody();
7878
expect(htmlElement.relativeOffset({x: 100, y: 150})).to.eql({x: 92, y: 142});

src/client/html_element.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,15 @@
189189
}
190190

191191
function relativeOffset(self, pageX, pageY) {
192+
console.log("X: " + pageX);
193+
console.log("Y: " + pageY);
194+
192195
var pageOffset = self._element.offset();
193196

197+
console.log("pageOffset", pageOffset);
198+
console.log("body", $(document.body).offset());
199+
console.log("offsetTop", self._element.offsetTop);
200+
194201
return {
195202
x: pageX - pageOffset.left,
196203
y: pageY - pageOffset.top

0 commit comments

Comments
 (0)