mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-31 16:23:50 +02:00
Fix up spiderfier breaking animation counting
This commit is contained in:
@@ -261,6 +261,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
|
||||
map.removeLayer(m._spiderLeg);
|
||||
delete m._spiderLeg;
|
||||
}
|
||||
group._animationEnd();
|
||||
}, 250);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -152,7 +152,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
},
|
||||
|
||||
_moveEnd: function () {
|
||||
if (this._inZoomAnimation > 0) {
|
||||
if (this._inZoomAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -343,6 +343,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
//Animated versions here
|
||||
_animationStart: function () {
|
||||
this._map._mapPane.className += ' leaflet-cluster-anim';
|
||||
this._inZoomAnimation++;
|
||||
},
|
||||
_animationEnd: function () {
|
||||
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
|
||||
@@ -402,8 +403,6 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
c._recursivelyRestoreChildPositions(depthToDescend);
|
||||
});
|
||||
|
||||
this._inZoomAnimation++;
|
||||
|
||||
//Remove the old clusters and close the zoom animation
|
||||
|
||||
setTimeout(function () {
|
||||
@@ -431,8 +430,6 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
//Animate all of the markers in the clusters to move to their cluster center point
|
||||
marker._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, depthToStartAt, depthToAnimateIn);
|
||||
|
||||
this._inZoomAnimation++;
|
||||
|
||||
var me = this;
|
||||
|
||||
//Update the opacity (If we immediately set it they won't animate)
|
||||
@@ -486,6 +483,5 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
|
||||
//Could loop all this._layers and do this for each _icon if it stops working
|
||||
|
||||
L.Util.falseFn(document.body.offsetWidth);
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user