Skip to content

Commit 7bd221e

Browse files
committed
added additional func edits
1 parent 58d612e commit 7bd221e

File tree

1 file changed

+3
-39
lines changed

1 file changed

+3
-39
lines changed

src/components/Canvas.vue

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<!-- https://www.npmjs.com/package/vue-draggable-resizable -->
1717
<p class="cssContainerText"> {{this.activeRoute}} Preview </p>
1818
<!--each component box in canvas will have these properties-->
19-
<!-- :onDragStart="recordInitialPosition" :onResizeStart="recordInitialSize" :preventDeactivation="true" graveyard attribute -->
2019
<vue-draggable-resizable
2120
class-name="component-box"
2221
v-for="componentData in activeRouteArray"
@@ -347,7 +346,6 @@
347346
import { useExportComponent } from "./composables/useExportComponent.js";
348347
import { mapState, mapActions } from "vuex";
349348
import VueDraggableResizable from "vue-draggable-resizable/src/components/vue-draggable-resizable.vue";
350-
// import Vue3DraggableResizable from 'vue3-draggable-resizable'
351349
import VueMultiselect from "vue-multiselect";
352350
import "vue-draggable-resizable/src/components/vue-draggable-resizable.css";
353351
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css'
@@ -360,7 +358,6 @@ const cloneDeep = require("lodash.clonedeep");
360358
export default {
361359
name: "Canvas",
362360
components: {
363-
// Vue3DraggableResizable,
364361
VueDraggableResizable,
365362
VueMultiselect,
366363
ColorPicker,
@@ -374,8 +371,6 @@ export default {
374371
noteModal: false,
375372
colorModal: false,
376373
mockImg: false,
377-
// initialPosition: { x: 0, y: 0 },
378-
// initialSize: { w: 0, h: 0 },
379374
htmlElements: [],
380375
childrenSelected: [],
381376
};
@@ -523,19 +518,6 @@ export default {
523518
useExportComponentBound() {
524519
useExportComponent.bind(this)();
525520
},
526-
// !records component's initial position in case of drag - CHRIS: probably don't need this function?
527-
// recordInitialPosition: function (e) {
528-
// if (this.activeComponent !== e.target.id) {
529-
// if (e.target.parentElement?.classList.contains('draggable')) {
530-
// // this.setActiveComponent(e.target.parentElement.id)
531-
// }
532-
// else if (typeof `${e.target.id}` !== 'number') {
533-
// // this.setActiveComponent(e.target.id);
534-
// }
535-
// }
536-
// this.initialPosition.x = this.activeComponentData.x;
537-
// this.initialPosition.y = this.activeComponentData.y;
538-
// },
539521
isElementPlus(htmlList) {
540522
return htmlList.find(({ text }) => text[0] === 'e');
541523
},
@@ -550,14 +532,6 @@ export default {
550532
this.updateColor(payload)
551533
this.refresh();
552534
},
553-
554-
// records component's initial size/position in case of resize (also graveyard - dont need initial size?)
555-
// recordInitialSize: function (e) {
556-
// this.initialSize.h = this.activeComponentData.h;
557-
// this.initialSize.w = this.activeComponentData.w;
558-
// this.initialPosition.x = this.activeComponentData.x;
559-
// this.initialPosition.y = this.activeComponentData.y;
560-
// },
561535
// sets component's ending size/position
562536
finishedResize: function (x, y, w, h) {
563537
let payload = {
@@ -569,19 +543,12 @@ export default {
569543
routeArray: this.routes[this.activeRoute],
570544
activeComponentData: this.activeComponentData,
571545
};
572-
// if (
573-
// payload.x !== this.initialPosition.x ||
574-
// payload.y !== this.initialPosition.y ||
575-
// payload.w !== this.initialSize.w ||
576-
// payload.h !== this.initialSize.h
577-
// ) {
578546
this.updateComponentSize(payload);
579547
this.updateComponentGridPosition(payload);
580-
// }
581548
this.refresh();
582549
},
583550
584-
//refresh function - super ghetto refresh function
551+
// refresh function
585552
refresh() {
586553
const payload = {
587554
activeComponent: this.activeComponent,
@@ -594,7 +561,7 @@ export default {
594561
payload.z--;
595562
this.updateComponentLayer(payload);
596563
},
597-
//!drag and drop function
564+
// drag and drop function
598565
finishedDrag: function (x, y) {
599566
let payload = {
600567
x: x,
@@ -650,7 +617,7 @@ export default {
650617
this.openNoteModal();
651618
}
652619
},
653-
//color editor - opens the pop up
620+
//color editor - opens the pop up
654621
handleEditColor() {
655622
if (this.wasDragged === false && this.activeComponent !== '') {
656623
this.openColorModal();
@@ -892,7 +859,6 @@ behavior: url(/pie/PIE.htc);
892859
height: 720px;
893860
background-color: rgba(223, 218, 218, 0.886);
894861
background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
895-
// background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
896862
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px),
897863
-webkit-linear-gradient(0, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
898864
-webkit-linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
@@ -971,15 +937,13 @@ behavior: url(/pie/PIE.htc);
971937
.component-box {
972938
color: $menutext;
973939
border: 1.2px dashed $darktext;
974-
// background-color: rgba($darktext, .42);
975940
-webkit-transition: background-color 200ms linear;
976941
-ms-transition: background-color 200ms linear;
977942
transition: background-color 200ms linear;
978943
position: absolute;
979944
}
980945
981946
.active {
982-
// background-color: rgba($secondary, .42);
983947
border: 3px solid $primary;
984948
}
985949

0 commit comments

Comments
 (0)