aboutsummaryrefslogtreecommitdiffstats
path: root/linkHints.js
diff options
context:
space:
mode:
authorjez2010-12-28 17:14:41 +0800
committerjez2010-12-28 17:14:41 +0800
commitbc752823e5f531068cb765de4e01740c7296ec42 (patch)
tree4e9645cb436e8b01380d299755694e750f3f8781 /linkHints.js
parent04100b83aabe100d25f71ea25b3cdf2b50c30939 (diff)
downloadvimium-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.js19
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;