diff options
| -rw-r--r-- | content_scripts/link_hints.coffee | 9 | ||||
| -rw-r--r-- | lib/dom_utils.coffee | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 6ea10377..083e214e 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -196,8 +196,8 @@ class LinkHintsMode localHintDescriptor = HintCoordinator.getLocalHintMarker desc el = DomUtils.createElement "div" el.rect = localHintDescriptor.rect - el.style.left = el.rect.left + window.scrollX + "px" - el.style.top = el.rect.top + window.scrollY + "px" + el.style.left = el.rect.left + "px" + el.style.top = el.rect.top + "px" extend el, className: "vimiumReset internalVimiumHintMarker vimiumHintMarker" showLinkText: localHintDescriptor.showLinkText @@ -718,6 +718,11 @@ LocalHints = # click some elements that we could click before. nonOverlappingElements.push visibleElement unless visibleElement.secondClassCitizen + # Position the rects within the window. + for hint in nonOverlappingElements + hint.rect.top += window.scrollY + hint.rect.left += window.scrollX + if Settings.get "filterLinkHints" @withLabelMap (labelMap) => extend hint, @generateLinkText labelMap, hint for hint in localHints diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index a57cbedb..3d719337 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -265,8 +265,8 @@ DomUtils = flashEl = @createElement "div" flashEl.id = "vimiumFlash" flashEl.className = "vimiumReset" - flashEl.style.left = rect.left + window.scrollX + "px" - flashEl.style.top = rect.top + window.scrollY + "px" + flashEl.style.left = rect.left + "px" + flashEl.style.top = rect.top + "px" flashEl.style.width = rect.width + "px" flashEl.style.height = rect.height + "px" document.documentElement.appendChild flashEl |
