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,
|
left = 0,
|
||||||
el = element,
|
el = element,
|
||||||
docBody = document.body,
|
docBody = document.body,
|
||||||
|
docEl = document.documentElement,
|
||||||
pos,
|
pos,
|
||||||
ie7 = L.Browser.ie7;
|
ie7 = L.Browser.ie7;
|
||||||
|
|
||||||
@ -45,8 +46,8 @@ L.DomUtil = {
|
|||||||
if (el.offsetParent === docBody && pos === 'absolute') { break; }
|
if (el.offsetParent === docBody && pos === 'absolute') { break; }
|
||||||
|
|
||||||
if (pos === 'fixed') {
|
if (pos === 'fixed') {
|
||||||
top += docBody.scrollTop || 0;
|
top += docBody.scrollTop || docEl.scrollTop || 0;
|
||||||
left += docBody.scrollLeft || 0;
|
left += docBody.scrollLeft || docEl.scrollLeft || 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
el = el.offsetParent;
|
el = el.offsetParent;
|
||||||
|
Loading…
Reference in New Issue
Block a user