mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-24 07:29:28 +00:00
handle additionalRow disabling outside Grid.js and recreate behavior before commit a8f680810f
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user