From 6af6ca04b16eb4d803dd02728083b82fb208e7e5 Mon Sep 17 00:00:00 2001 From: Julian Leucker <leuckerj@gmail.com> Date: Fri, 10 Feb 2023 12:15:19 +0100 Subject: [PATCH] Enable highlight disablement --- example/src/App.vue | 1 + src/DragGrid.vue | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example/src/App.vue b/example/src/App.vue index c3e9ee4..9c15922 100644 --- a/example/src/App.vue +++ b/example/src/App.vue @@ -125,6 +125,7 @@ import NumberCounter from "./components/NumberCounter.vue"; context="lesson" grid-id="lesson-storage" @itemChanged="handleLessonDropInContainer" + no-highlight > <template #item="item"> <div class="container">{{ item }}</div> diff --git a/src/DragGrid.vue b/src/DragGrid.vue index 15a4697..18e7909 100644 --- a/src/DragGrid.vue +++ b/src/DragGrid.vue @@ -79,6 +79,11 @@ export default { required: false, default: uuidv4, }, + noHighlight: { + type: Boolean, + required: false, + default: false, + }, }, methods: { positionAllowed(x, y, key) { @@ -108,7 +113,7 @@ export default { let element = JSON.parse(data); let coords = this.getCoords(event.layerX, event.layerY); - if (element.context !== this.context) { + if (element.context !== this.context || this.noHighlight) { this.$refs.highlightContainer.style.display = "none"; return; } -- GitLab