Skip to content

Commit 1d6c0e1

Browse files
authored
Merge pull request jbaysolutions#44 from neithere/master
Support user-defined selectors to ignore during drag/resize
2 parents c97c3e6 + 81721c2 commit 1d6c0e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/GridItem.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@
155155
},
156156
i: {
157157
required: true
158+
},
159+
dragIgnoreFrom: {
160+
type: String,
161+
required: false,
162+
default: 'a, button'
163+
},
164+
resizeIgnoreFrom: {
165+
type: String,
166+
required: false,
167+
default: 'a, button'
158168
}
159169
},
160170
inject: ["eventBus"],
@@ -275,7 +285,7 @@
275285
draggable: function() {
276286
var self = this;
277287
if (this.interactObj == null) {
278-
this.interactObj = interact(this.$refs.item, {ignoreFrom: "a, button"});
288+
this.interactObj = interact(this.$refs.item, {ignoreFrom: this.dragIgnoreFrom});
279289
}
280290
if (this.draggable) {
281291
this.interactObj.draggable({});
@@ -297,7 +307,7 @@
297307
resizable: function() {
298308
var self = this;
299309
if (this.interactObj == null) {
300-
this.interactObj = interact(this.$refs.item, {ignoreFrom: "a, button"});
310+
this.interactObj = interact(this.$refs.item, {ignoreFrom: resizeIgnoreFrom});
301311
}
302312
if (this.resizable) {
303313
this.interactObj

0 commit comments

Comments
 (0)