|
|
@ -30,6 +30,7 @@ |
|
|
|
forceFallback : { type: Boolean, value: false, observer: "forceFallbackChanged" }, |
|
|
|
forceFallback : { type: Boolean, value: false, observer: "forceFallbackChanged" }, |
|
|
|
fallbackClass : { type: String, value: "sortable-fallback", observer: "fallbackClassChanged" }, |
|
|
|
fallbackClass : { type: String, value: "sortable-fallback", observer: "fallbackClassChanged" }, |
|
|
|
fallbackOnBody : { type: Boolean, value: false, observer: "fallbackOnBodyChanged" }, |
|
|
|
fallbackOnBody : { type: Boolean, value: false, observer: "fallbackOnBodyChanged" }, |
|
|
|
|
|
|
|
manuallyHandleUpdateEvents : { type: Boolean, value: false }, |
|
|
|
draggable : {}, |
|
|
|
draggable : {}, |
|
|
|
scroll : {} |
|
|
|
scroll : {} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -78,7 +79,11 @@ |
|
|
|
this.sortable = Sortable.create(this, Object.assign(options, { |
|
|
|
this.sortable = Sortable.create(this, Object.assign(options, { |
|
|
|
onUpdate: e => { |
|
|
|
onUpdate: e => { |
|
|
|
if (template) { |
|
|
|
if (template) { |
|
|
|
|
|
|
|
if(manuallyHandleUpdateEvents) { |
|
|
|
template.items.splice(e.newIndex, 0, template.items.splice(e.oldIndex, 1)[0]); |
|
|
|
template.items.splice(e.newIndex, 0, template.items.splice(e.oldIndex, 1)[0]); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
template.splice("items", e.newIndex, 0, template.splice("items", e.oldIndex, 1)[0]) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.fire("update", e) |
|
|
|
this.fire("update", e) |
|
|
|
}, |
|
|
|
}, |
|
|
|