mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
add shared cleanup function to prevent duplicate code
This commit is contained in:
@@ -487,13 +487,18 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
_cleanupDragging() {
|
||||
if (this.draggedItem) {
|
||||
this.draggedItem = null;
|
||||
}
|
||||
},
|
||||
dragCancel() {
|
||||
this.removeWidgetClones();
|
||||
this.additionalRowComputed = false;
|
||||
this.mode = MODE_IDLE;
|
||||
this.tempPositionUpdates = null;
|
||||
this.draggedOffset = [0,0],
|
||||
this.draggedItem = null;
|
||||
this.draggedOffset = [0,0];
|
||||
this._cleanupDragging();
|
||||
},
|
||||
dragEnd() {
|
||||
this.removeWidgetClones();
|
||||
@@ -518,7 +523,7 @@ export default {
|
||||
if (updated.length)
|
||||
this.$emit('rearrangeItems', updated.filter(v => v));
|
||||
|
||||
this.draggedItem = null;
|
||||
this._cleanupDragging();
|
||||
},
|
||||
_updateCorrectedPositions(updated) {
|
||||
updated.forEach((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user