Skip to content

Commit 906383c

Browse files
Making isCloning a data (working on issue #504)
1 parent b6b5a17 commit 906383c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/vuedraggable.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ const draggableComponent = {
103103
return {
104104
transitionMode: false,
105105
noneFunctionalComponentMode: false,
106-
init: false
106+
init: false,
107+
isCloning: false
107108
};
108109
},
109110

@@ -182,14 +183,6 @@ const draggableComponent = {
182183
return this.transitionMode ? this.$el.children[0] : this.$el;
183184
},
184185

185-
isCloning() {
186-
return (
187-
!!this.options &&
188-
!!this.options.group &&
189-
this.options.group.pull === "clone"
190-
);
191-
},
192-
193186
realList() {
194187
return this.list ? this.list : this.value;
195188
}
@@ -213,6 +206,14 @@ const draggableComponent = {
213206
},
214207

215208
methods: {
209+
getIsCloning() {
210+
return (
211+
!!this.options &&
212+
!!this.options.group &&
213+
this.options.group.pull === "clone"
214+
);
215+
},
216+
216217
getChildrenNodes() {
217218
if (!this.init) {
218219
this.noneFunctionalComponentMode =
@@ -326,6 +327,7 @@ const draggableComponent = {
326327

327328
onDragStart(evt) {
328329
this.context = this.getUnderlyingVm(evt.item);
330+
this.isCloning = this.getIsCloning();
329331
evt.item._underlying_vm_ = this.clone(this.context.element);
330332
draggingElement = evt.item;
331333
},

0 commit comments

Comments
 (0)