Merge pull request #1745 from jec006/calculate-y-mouse
Properly calculate the y position of the element when parent is positioned relatively
This commit is contained in:
commit
043fa18f1a
@ -53,13 +53,16 @@ L.DomUtil = {
|
||||
|
||||
if (pos === 'relative' && !el.offsetLeft) {
|
||||
var width = L.DomUtil.getStyle(el, 'width'),
|
||||
maxWidth = L.DomUtil.getStyle(el, 'max-width');
|
||||
maxWidth = L.DomUtil.getStyle(el, 'max-width'),
|
||||
r = el.getBoundingClientRect();
|
||||
|
||||
if (width !== 'none' || maxWidth !== 'none') {
|
||||
var r = el.getBoundingClientRect();
|
||||
left += r.left + el.clientLeft;
|
||||
}
|
||||
|
||||
//calculate full y offset since we're breaking out of the loop
|
||||
top += r.top + (docBody.scrollTop || docEl.scrollTop || 0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user