handle additionalRow disabling outside Grid.js and recreate behavior before commit a8f680810f

This commit is contained in:
chfhtw
2026-04-22 10:03:13 +02:00
parent 5571353464
commit 3ab7a61a47
2 changed files with 10 additions and 15 deletions
+7 -2
View File
@@ -40,7 +40,7 @@ export default {
configOpened: false,
gridWidth: 1,
gridHeight: null,
additionalRow:false
additionalRow: false
};
},
provide() {
@@ -124,6 +124,11 @@ export default {
return placedItems.filter(item => !item.hidden);
}
},
watch: {
items() {
this.additionalRow = false;
}
},
methods: {
handleConfigOpened() {
this.configOpened = true
@@ -217,7 +222,7 @@ export default {
>+</button>
<drop-grid
v-model:cols="gridWidth"
v-model:additional-row="additionalRow"
:additional-row="additionalRow"
:items="items"
:items-setup="indexedWidgetsTemplates"
:active="editModeIsActive"
+3 -13
View File
@@ -29,8 +29,7 @@ export default {
},
emits: [
"rearrangeItems",
"gridHeight",
"update:additionalRow"
"gridHeight"
],
data() {
return {
@@ -55,7 +54,7 @@ export default {
computed: {
// gridlogic
rows() {
if (this.additionalRowComputed) {
if (this.additionalRow) {
if (this.overwriteRows !== null)
return this.overwriteRows + 1;
return this.grid ? (this.grid.h+1) : 1;
@@ -64,14 +63,6 @@ export default {
return this.overwriteRows;
return this.grid ? this.grid.h : 1;
},
additionalRowComputed: {
get() {
return this.additionalRow;
},
set(value) {
this.$emit('update:additionalRow', value);
}
},
gridStyle() {
const addH = this.active ? this.marginForExtraRow : 0;
return {
@@ -126,7 +117,7 @@ export default {
};
});
if (this.additionalRowComputed) {
if (this.additionalRow) {
for (var x = 0; x < this.cols; x++)
placeholders.push({
x,
@@ -531,7 +522,6 @@ export default {
return;
}
this.additionalRowComputed = false;
this.tempPositionUpdates = null;
this.draggedOffset = [0,0];
this._cleanupDragging();