mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Prevent multiple clustermouseover/off events if the icon is made up of stacked divs. Fixes #252.
Doesn't fix this bug in IE <= 8 as they don't support relatedTarget, could fix it by looking at the event type and using fromElement/toElement, but I'm not going to.
This commit is contained in:
@@ -547,8 +547,22 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
delete marker.__parent;
|
||||
},
|
||||
|
||||
_isOrIsParent: function (el, oel) {
|
||||
while (oel) {
|
||||
if (el === oel) {
|
||||
return true;
|
||||
}
|
||||
oel = oel.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
_propagateEvent: function (e) {
|
||||
if (e.layer instanceof L.MarkerCluster) {
|
||||
//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)
|
||||
if (this._isOrIsParent(e.layer._icon, e.originalEvent.relatedTarget)) {
|
||||
return;
|
||||
}
|
||||
e.type = 'cluster' + e.type;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user