Skip to content

Commit

Permalink
Switch from pure document.body for badge flyout Firefox compatibility. (
Browse files Browse the repository at this point in the history
rauchg#226)

* update from document.body to document.documentElement for Firefox compatibility. fixes rauchg#182.

* document.documentElement is no more cross-browser than .body. Switching to window.scrollY, with a fallback to docbody for IE.
  • Loading branch information
egid authored and rauchg committed Oct 22, 2016
1 parent 61c63c3 commit e0f09a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assets/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@
var iframePos = iframe.getBoundingClientRect()
var divHeight = divPos.height + arrowHeight

var st = document.body.scrollTop
var sl = document.body.scrollLeft
var st = window.scrollY || document.body.scrollTop
var sl = window.scrollX || document.body.scrollLeft
var iw = window.innerWidth
var ih = window.innerHeight
var iframeTop = iframePos.top + st
Expand Down

0 comments on commit e0f09a5

Please sign in to comment.