Skip to content
Snippets Groups Projects

Resolve "Implement basic functionality"

Merged Julian requested to merge 1-implement-basic-functionality into main
1 file
+ 10
3
Compare changes
  • Side-by-side
  • Inline
+ 10
3
@@ -199,6 +199,9 @@ export default {
@@ -199,6 +199,9 @@ export default {
if (!newPositionValid) return;
if (!newPositionValid) return;
 
element.x = coords.x;
 
element.y = coords.y;
 
try {
try {
let valueCopy = structuredClone(this.value);
let valueCopy = structuredClone(this.value);
@@ -207,7 +210,12 @@ export default {
@@ -207,7 +210,12 @@ export default {
});
});
if (index >= 0) valueCopy.splice(index, 1);
if (index >= 0) valueCopy.splice(index, 1);
valueCopy.push(element);
let elementCopy = structuredClone(element);
 
 
elementCopy.context = undefined;
 
elementCopy.originGridId = undefined;
 
 
valueCopy.push(elementCopy);
this.$emit("input", valueCopy);
this.$emit("input", valueCopy);
} catch (e) {
} catch (e) {
if (e.code === DOMException.DATA_CLONE_ERR) {
if (e.code === DOMException.DATA_CLONE_ERR) {
@@ -220,9 +228,8 @@ export default {
@@ -220,9 +228,8 @@ export default {
}
}
}
}
element.x = coords.x;
element.y = coords.y;
element.gridId = this.gridId;
element.gridId = this.gridId;
 
this.$emit("itemChanged", element);
this.$emit("itemChanged", element);
},
},
getCoords(x, y) {
getCoords(x, y) {
Loading