diff options
| author | jez | 2010-12-28 17:14:41 +0800 |
|---|---|---|
| committer | jez | 2010-12-28 17:14:41 +0800 |
| commit | bc752823e5f531068cb765de4e01740c7296ec42 (patch) | |
| tree | 4e9645cb436e8b01380d299755694e750f3f8781 /linkHints.js | |
| parent | 04100b83aabe100d25f71ea25b3cdf2b50c30939 (diff) | |
| download | vimium-bc752823e5f531068cb765de4e01740c7296ec42.tar.bz2 | |
Revert "Fix hint marker positioning when body's position is not static. Closes #140."
This reverts commit 416925e540067f56834bf9f6b7a4b21a77448926.
Diffstat (limited to 'linkHints.js')
| -rw-r--r-- | linkHints.js | 19 |
1 files 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; |
