diff options
| author | gdh1995 | 2016-10-07 01:51:49 +0800 | 
|---|---|---|
| committer | gdh1995 | 2016-10-08 00:38:07 +0800 | 
| commit | d14ec3b571df2d0581506e329e593d5cd2344aa7 (patch) | |
| tree | 85c51c91229db2a8bcd49fb7e91e9ddf86812958 /content_scripts/link_hints.coffee | |
| parent | 49194546a00ba5d9540b252fb10a699319c0d64d (diff) | |
| download | vimium-d14ec3b571df2d0581506e329e593d5cd2344aa7.tar.bz2 | |
handle documentElement's top margin correctly
Diffstat (limited to 'content_scripts/link_hints.coffee')
| -rw-r--r-- | content_scripts/link_hints.coffee | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index c86eabf1..b5fa527d 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -811,9 +811,16 @@ LocalHints =          nonOverlappingElements.push visibleElement unless visibleElement.secondClassCitizen      # Position the rects within the window. +    if getComputedStyle(document.documentElement).position == "static" +      top = window.scrollY +      left = window.scrollX +    else +      rect = document.documentElement.getBoundingClientRect() +      top = -rect.top +      left = -rect.left      for hint in nonOverlappingElements -      hint.rect.top += window.scrollY -      hint.rect.left += window.scrollX +      hint.rect.top += top +      hint.rect.left += left      if Settings.get "filterLinkHints"        @withLabelMap (labelMap) =>  | 
