From 8a53c438e3a55089b76336b2c1af3eb347bc6119 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Mon, 30 Mar 2026 15:01:03 +0200 Subject: [PATCH] more cleanup of dropgrid code --- public/js/components/Drop/Grid.js | 33 ++++++------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/public/js/components/Drop/Grid.js b/public/js/components/Drop/Grid.js index 8f048de94..75fdefda6 100644 --- a/public/js/components/Drop/Grid.js +++ b/public/js/components/Drop/Grid.js @@ -11,12 +11,6 @@ export default { components: { GridItem, }, - inject: { - sectionName: { - type: String, - default: '', - } - }, props: { cols: Number, items: Array, @@ -37,7 +31,6 @@ export default { }, emits: [ "rearrangeItems", - "newItem", "gridHeight", "draggedItem", "update:additionalRow" @@ -51,7 +44,6 @@ export default { mode: MODE_IDLE, grid: null, dragGrid: null, - permUpdates: [], positionUpdates: null, fixedPositionUpdates: null, draggedOffset: [0, 0], @@ -123,8 +115,11 @@ export default { } return placeholders; }, - placedItems_withPlaceholders() { - return [...this.placedItems, ...this.items_placeholders]; + currentItems() { + if (this.mode != 1 && this.mode != 2 && this.active) + return [ ...this.placedItems, ...this.items_placeholders ]; + + return this.placedItems; }, rows() { if (this.additionalRowComputed) { @@ -209,17 +204,6 @@ export default { } }) return [...mappedPlacedItems, ...temporaryResizeItems]; - }, - showEmptyTileHover() { - if (!this.active || !this.grid || this.mode != MODE_IDLE || this.x < 0 || this.y < 0 || this.x >= this.cols || this.y >= this.rows) - return false; - return this.grid.isFreeSlot(this.x, this.y); - }, - currentItems() { - if (this.mode != 1 && this.mode != 2 && this.active) - return this.placedItems_withPlaceholders; - - return this.placedItems; } }, watch: { @@ -436,7 +420,6 @@ export default { dragOver(evt) { if ((this.y + 1) > this.rows && (this.mode == MODE_MOVE || this.mode == MODE_RESIZE)) { this.dragCancel(); - } if (!this.active) return this.dragCancel(); @@ -532,10 +515,6 @@ export default { } return updated; }, - emptyTileClicked() { - this.additionalRowComputed = false; - this.$emit('newItem', this.x, this.y); - }, updateCursorOnMouseMove(evt) { if (this.mode == MODE_IDLE) { this.updateCursor(evt); @@ -609,7 +588,7 @@ export default { }, mouseUp() { this.mode = MODE_IDLE; - }, + } }, template: /* html */`