Merge pull request #1365 from joschka/fix-viewport-offset
Fix viewport offset calculation in Firefox (fixes issue #1322)
This commit is contained in:
commit
3bb34f3f55
@ -29,6 +29,7 @@ L.DomUtil = {
|
||||
left = 0,
|
||||
el = element,
|
||||
docBody = document.body,
|
||||
docEl = document.documentElement,
|
||||
pos,
|
||||
ie7 = L.Browser.ie7;
|
||||
|
||||
@ -45,8 +46,8 @@ L.DomUtil = {
|
||||
if (el.offsetParent === docBody && pos === 'absolute') { break; }
|
||||
|
||||
if (pos === 'fixed') {
|
||||
top += docBody.scrollTop || 0;
|
||||
left += docBody.scrollLeft || 0;
|
||||
top += docBody.scrollTop || docEl.scrollTop || 0;
|
||||
left += docBody.scrollLeft || docEl.scrollLeft || 0;
|
||||
break;
|
||||
}
|
||||
el = el.offsetParent;
|
||||
|
Loading…
Reference in New Issue
Block a user