canvas-editor-engine 2.3.56 → 2.3.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +14 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -2611,14 +2611,21 @@ var DrawLayersService = function() {
|
|
2611
2611
|
status: "error",
|
2612
2612
|
message: "Replaceable layer not found"
|
2613
2613
|
});
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
_this.layerList[index].order = layer.order - 1;
|
2620
|
-
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", _this.layerList[index]);
|
2614
|
+
_this.layerList.sort((function(a, b) {
|
2615
|
+
return a.order - b.order;
|
2616
|
+
}));
|
2617
|
+
var layerIdx = _this.layerList.findIndex((function(layer) {
|
2618
|
+
return layer.id === id;
|
2621
2619
|
}));
|
2620
|
+
var replaceableIdx = _this.layerList.findIndex((function(layer) {
|
2621
|
+
return layer.order === newOrder;
|
2622
|
+
}));
|
2623
|
+
_this.layerList.slice(layerIdx + 1, replaceableIdx + 1).forEach((function(rlayer, idx) {
|
2624
|
+
_this.layerList[idx].order = rlayer.order - 1;
|
2625
|
+
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", _this.layerList[idx]);
|
2626
|
+
}));
|
2627
|
+
_this.layerList[layerIdx].order = newOrder;
|
2628
|
+
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", layer);
|
2622
2629
|
} else {
|
2623
2630
|
layer.order = newOrder;
|
2624
2631
|
_this.layerList[layerIndex] = layer;
|