Skip to content

Commit

Permalink
Fix for the glitch affecting page blocks after a move
Browse files Browse the repository at this point in the history
  • Loading branch information
kelanik8 committed Aug 29, 2024
1 parent 6683568 commit 1be6aa5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions client/web/compose/src/components/Common/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
style="touch-action: none;"
@move="onGridAction"
@resize="onGridAction"
@moved="onBlockUpdated(index)"
@resized="onBlockUpdated(index)"
>
<slot
:block="blocks[item.i]"
Expand Down Expand Up @@ -142,15 +140,18 @@ export default {
},
methods: {
onBlockUpdated (index) {
this.$emit('item-updated', index)
const { x, y, w, h } = this.layout[index]
this.blocks[index].xywh = [x, y, w, h]
},
onLayoutUpdated () {
this.resizing = false
this.blocks.forEach(({ xywh = [] }, idx) => {
const { x, y, w, h } = this.layout[idx]
const layoutXYWH = [x, y, w, h]
if (xywh.toString() === layoutXYWH.toString()) return
this.$emit('item-updated', idx)
this.blocks[idx].xywh = layoutXYWH
})
},
onGridAction () {
Expand Down

0 comments on commit 1be6aa5

Please sign in to comment.