From 6787b9b553970253709587a72a8307c8e89ac03e Mon Sep 17 00:00:00 2001 From: chfhtw Date: Fri, 17 Apr 2026 10:46:00 +0200 Subject: [PATCH] correct pinned widget detection => before it only accounted for 1x1 widgets --- public/js/components/Drop/Grid.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/public/js/components/Drop/Grid.js b/public/js/components/Drop/Grid.js index 538418cc3..32918572f 100644 --- a/public/js/components/Drop/Grid.js +++ b/public/js/components/Drop/Grid.js @@ -527,22 +527,26 @@ export default { }, checkPinnedWidgetAnimation() { let itemAtPosition = []; + const itemCoord = {}; switch (this.mode) { case MODE_RESIZE: - for (let x = this.draggedItem.x; x <= this.x; x++) { - for (let y = this.draggedItem.y; y <= this.y; y++) { - this.items.forEach(item => { - if (item.x == x && item.y == y) { - itemAtPosition.push(item); - } - }); - } - } + itemCoord.x = this.draggedItem.x; + itemCoord.y = this.draggedItem.y; + itemCoord.w = this.x - this.draggedItem.x + 1; + itemCoord.h = this.y - this.draggedItem.y + 1; break; case MODE_MOVE: - itemAtPosition = this.items.filter(item=>item.x == this.x && item.y == this.y); + itemCoord.x = this.x; + itemCoord.y = this.y; + itemCoord.w = this.draggedItem.w; + itemCoord.h = this.draggedItem.h; break; } + const frame = this.grid.getItemFrame(itemCoord); + const itemsAtPosition = this.grid.getItemsInFrame(frame); + const blockersAtPosition = itemsAtPosition.filter(index => this.indexedItems[index].pinned); + + itemAtPosition = blockersAtPosition.map(index => this.indexedItems[index].data); Array.from(document.getElementsByClassName("denied-dragging-animation"))?.forEach(ele => { ele.classList.remove("denied-dragging-animation");