This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( typeof document.currentScript == "undefined" && document.__defineGetter__ ) { | |
| document.__defineGetter__("currentScript", function (){ | |
| try { | |
| throw new Error() | |
| } | |
| catch ( e ) { | |
| var qualifiedUrl = location.protocol + "//" + location.host | |
| , srcs = e.stack.match(new RegExp(qualifiedUrl + ".*?\\.js", 'g')) | |
| , src = srcs[srcs.length - 1] | |
| , absoluteUrl = src.replace(qualifiedUrl, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // get the actually scrollable element | |
| function getScrollable( root ){ | |
| if ( !root.nodeName || !!~["iframe", "#document", "html", "body"].indexOf(root.nodeName.toLowerCase()) ) { | |
| var doc = (root.contentWindow || root).document || root.ownerDocument || root | |
| root = /webkit/i.test(navigator.userAgent) || doc.compatMode == "BackCompat" | |
| ? doc.body | |
| : doc.documentElement; | |
| } | |
| return root | |
| } |