From 3b3e75003f063d4ae5acd2a4b22d2efdd9b66884 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Fri, 17 Apr 2026 10:01:13 +0200 Subject: [PATCH] indentation --- public/js/composables/GridLogic.js | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/public/js/composables/GridLogic.js b/public/js/composables/GridLogic.js index 773f766a2..1a540ea06 100644 --- a/public/js/composables/GridLogic.js +++ b/public/js/composables/GridLogic.js @@ -122,29 +122,29 @@ class GridLogic { const targetAndItemOverlap = this.getItemFrame(item).some(frame => currItem.frame.includes(frame)) if (!targetAndItemOverlap) { - let occupiersData = occupiers.map(occupier => this.data[occupier]); + let occupiersData = occupiers.map(occupier => this.data[occupier]); // checks if target contains widget with the same high and width // so swapping is possible const occupiersFrame = occupiers.map(occupier => this.data[occupier].frame).flat(); const occupiersInsideMovingItem = occupiersFrame.every(frame => currItem.frame.includes(frame)); if (occupiersInsideMovingItem) { - // every slot of all items in the target zone is inside said zone - let replaceUpdate = []; - let newOccupierFrames = []; - for(let f of originalFrame){ - if(newOccupierFrames.includes(f)){ - continue; + // every slot of all items in the target zone is inside said zone + let replaceUpdate = []; + let newOccupierFrames = []; + for(let f of originalFrame){ + if(newOccupierFrames.includes(f)){ + continue; + } + let occ = occupiersData.shift(); + if(occ){ + newOccupierFrames = [...newOccupierFrames, ...this.getItemFrame({ ...occ, ...this.getSingleFramePosition(f) })]; + replaceUpdate[occ.index] = { index: occ.index, ...this.getSingleFramePosition(f)} + } } - let occ = occupiersData.shift(); - if(occ){ - newOccupierFrames = [...newOccupierFrames, ...this.getItemFrame({ ...occ, ...this.getSingleFramePosition(f) })]; - replaceUpdate[occ.index] = { index: occ.index, ...this.getSingleFramePosition(f)} - } - } - replaceUpdate[item.index] = { index: item.index, x, y }; - - return replaceUpdate; + replaceUpdate[item.index] = { index: item.index, x, y }; + + return replaceUpdate; } }