From bc752823e5f531068cb765de4e01740c7296ec42 Mon Sep 17 00:00:00 2001 From: jez Date: Tue, 28 Dec 2010 17:14:41 +0800 Subject: Revert "Fix hint marker positioning when body's position is not static. Closes #140." This reverts commit 416925e540067f56834bf9f6b7a4b21a77448926. --- linkHints.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/linkHints.js b/linkHints.js index d1f2ddaa..3e19df97 100644 --- a/linkHints.js +++ b/linkHints.js @@ -326,20 +326,11 @@ function createMarkerFor(link, linkHintNumber, linkHintDigits) { // Note: this call will be expensive if we modify the DOM in between calls. var clientRect = link.rect; - var offsets = {}; - if (/^(absolute|fixed|relative)$/.test(window.getComputedStyle(document.body).position)) { - var bodyRect = document.body.getClientRects()[0]; - offsets.x = -bodyRect.left; - offsets.y = -bodyRect.top; - } else { - // The coordinates given by the window do not have the zoom factor included since the zoom is set only on - // the document node. - var zoomFactor = currentZoomLevel / 100.0; - offsets.x = window.scrollX / zoomFactor; - offsets.y = window.scrollY / zoomFactor; - } - marker.style.left = clientRect.left + offsets.x + "px"; - marker.style.top = clientRect.top + offsets.y + "px"; + // The coordinates given by the window do not have the zoom factor included since the zoom is set only on + // the document node. + var zoomFactor = currentZoomLevel / 100.0; + marker.style.left = clientRect.left + window.scrollX / zoomFactor + "px"; + marker.style.top = clientRect.top + window.scrollY / zoomFactor + "px"; marker.clickableItem = link.element; return marker; -- cgit v1.2.3