Skip to content

Commit c4d1c4a

Browse files
committed
added a handler for a right click on the background --> maybe add a modal allowing a component to be added directly in this manner?
1 parent 810f696 commit c4d1c4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/ComponentDisplay.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class="component-display grid-bg"
1111
:style="mockBg"
1212
v-on:click="handleClick"
13+
v-on:click.right="handleRight"
1314
>
1415
<!-- This is the actual component box -->
1516
<!-- https://www.npmjs.com/package/vue-draggable-resizable -->
@@ -325,7 +326,6 @@ export default {
325326
recordInitialPosition: function (e) {
326327
if (this.activeComponent !== e.target.id) {
327328
if (e.target.parentElement?.classList.contains('draggable')){
328-
//console.log("using vanilla JS to WIN")
329329
this.setActiveComponent(e.target.parentElement.id)
330330
} else {
331331
this.setActiveComponent(e.target.id);
@@ -455,7 +455,11 @@ export default {
455455
this.setActiveComponent("");
456456
}
457457
},
458-
copyActiveComponent() {},
458+
handleRight(event) {
459+
if (event.target.className === "component-display grid-bg") {
460+
//right click modal to make a component?
461+
}
462+
},
459463
},
460464
watch: {
461465
noteModalOpen (){

0 commit comments

Comments
 (0)