diff options
| -rw-r--r-- | lib/dom_utils.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index fad5ffbf..d39ce1de 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -289,8 +289,10 @@ DomUtils = setTimeout((-> DomUtils.removeElement flashEl), 400) getViewportTopLeft: -> - if getComputedStyle(document.documentElement).position == "static" - top: window.scrollY, left: window.scrollX + style = getComputedStyle document.documentElement + if style.position == "static" + zoom = +style.zoom || 1 + top: Math.ceil(window.scrollY / zoom), left: Math.ceil(window.scrollX / zoom) else rect = document.documentElement.getBoundingClientRect() top: -rect.top, left: -rect.left |
