Skip to content

Commit ad30650

Browse files
committed
finished ironing out bugs in Canvas.vue
> > Co-authored-by: ChrisDavis [email protected] Co-authored-by: JiKim [email protected] Co-authored-by: JigarPatel [email protected] Co-authored-by: LindenYoung [email protected]
1 parent daf6d72 commit ad30650

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/components/Canvas.vue

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ const updateColors = (data) => {
540540
color: data.cssColor,
541541
activeComponent: activeComponent.value,
542542
routeArray: routes.value[activeRoute.value],
543-
activeComponentData: activeComponentData,
543+
activeComponentData: activeComponentData.value,
544544
}
545545
updateColor(payload)
546546
refresh();
@@ -555,7 +555,7 @@ const finishedResize = (x, y, w, h) => {
555555
h: h,
556556
activeComponent: activeComponent.value,
557557
routeArray: routes.value[activeRoute.value],
558-
activeComponentData: activeComponentData,
558+
activeComponentData: activeComponentData.value,
559559
};
560560
updateComponentSize(payload);
561561
updateComponentGridPosition(payload);
@@ -564,11 +564,12 @@ const finishedResize = (x, y, w, h) => {
564564
565565
// refresh function
566566
const refresh = () => {
567+
console.log("Inside of refresh")
567568
const payload = {
568569
activeComponent: activeComponent.value,
569570
routeArray: routes.value[activeRoute.value],
570-
activeComponentData: activeComponentData,
571-
z: activeComponentData.z,
571+
activeComponentData: activeComponentData.value,
572+
z: activeComponentData.value.z,
572573
};
573574
payload.z++;
574575
updateComponentLayer(payload);
@@ -580,12 +581,13 @@ const refresh = () => {
580581
console.log(activeComponentData.value, "I AM ACTIVECOMPONENTDATA.value")
581582
// drag and drop function
582583
const finishedDrag = (x, y) => {
584+
console.log("Inside of finishedDrag")
583585
let payload = {
584586
x: x,
585587
y: y,
586588
activeComponent: activeComponent.value,
587589
routeArray: routes.value[activeRoute.value],
588-
activeComponentData: activeComponentData,
590+
activeComponentData: activeComponentData.value,
589591
};
590592
updateComponentPosition(payload);
591593
updateComponentGridPosition(payload);
@@ -620,14 +622,14 @@ const onActivated = (componentData) => {
620622
setActiveComponent(componentData.componentName);
621623
}
622624
if (componentData && componentData.hasOwnProperty('componentName')) {
623-
activeComponentData.isActive = true;
625+
activeComponentData.value.isActive = true;
624626
}
625627
}
626628
627629
// deactivated is emitted before activated
628630
const onDeactivated = () => {
629631
if (activeComponent.value !== "") {
630-
activeComponentData.isActive = false;
632+
activeComponentData.value.isActive = false;
631633
}
632634
}
633635
@@ -654,7 +656,7 @@ const submitNote = (e) => {
654656
if (noteText.value === '') {
655657
return;
656658
}
657-
addActiveComponentNote(noteText);
659+
addActiveComponentNote(noteText.value);
658660
noteText.value = '';
659661
}
660662
@@ -670,11 +672,12 @@ const handleSelect = (value) => { //actually handles adding or deleting
670672
// user can change component's layer order
671673
const handleLayer = (e) => {
672674
e.preventDefault();
675+
console.log("activeComponent is ", activeComponentData.value)
673676
const payload = {
674677
activeComponent: activeComponent.value,
675678
routeArray: routes.value[activeRoute.value],
676-
activeComponentData: activeComponentData,
677-
z: activeComponentData.z,
679+
activeComponentData: activeComponentData.value,
680+
z: activeComponentData.value.z,
678681
};
679682
680683
if (e.target.innerText === "+") payload.z++;
@@ -697,11 +700,11 @@ const handleRight = (event) => {
697700
698701
watch(noteModalOpen, () => {
699702
noteModal.value = noteModalOpen.value;
700-
});
703+
}, {deep:true});
701704
702705
watch(colorModalOpen, () => {
703706
colorModal.value = colorModalOpen.value;
704-
});
707+
}, {deep:true});
705708
706709
707710
watch(activeComponent, () => {
@@ -711,7 +714,8 @@ const handleRight = (event) => {
711714
store.commit("TOGGLE_TUTORIAL");
712715
}
713716
onActivated(activeComponentObj.value);
714-
}
717+
},
718+
{deep:true},
715719
)
716720
</script>
717721

0 commit comments

Comments
 (0)