vue-draggable
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0-rc.2
@@ -7,3 +7,4 @@ let VueDraggable = { | ||
multipleDropzonesItemsDraggingEnabled: true, | ||
onDrop: null | ||
onDrop: null, | ||
onDragstart: null | ||
}, | ||
@@ -195,2 +196,6 @@ targets: null, | ||
if (typeof this.defaultOptions.onDragstart === 'function') { | ||
this.defaultOptions.onDragstart(Object.assign({ nativeEvent: e }, this.selections)); | ||
} | ||
//[else] if the multiple selection modifier is pressed | ||
@@ -384,3 +389,3 @@ //and the item's grabbed state is currently false | ||
if (typeof this.defaultOptions.onDrop === 'function') { | ||
this.defaultOptions.onDrop(Object.assign({}, this.selections)); | ||
this.defaultOptions.onDrop(Object.assign({ nativeEvent: e }, this.selections)); | ||
} | ||
@@ -387,0 +392,0 @@ |
{ | ||
"name": "vue-draggable", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0-rc.2", | ||
"description": "Vuejs 2.0 directive for drag and drop", | ||
@@ -26,2 +26,2 @@ "main": "build/index.js", | ||
"homepage": "https://github.com/nikolasp/vue-draggable#readme" | ||
} | ||
} |
@@ -12,3 +12,3 @@ # vue-draggable | ||
``` | ||
npm install --save v-draggable | ||
npm install --save vue-draggable | ||
``` | ||
@@ -54,4 +54,13 @@ | ||
multipleDropzonesItemsDraggingEnabled: true, | ||
onDrop: null | ||
onDrop: function(event) {}, | ||
onDragstart: function(event) {} | ||
} | ||
// onDrop and onDragstart event | ||
{ | ||
nativeEvent: {}, // native js event | ||
items: [], // list of selected draggable elements | ||
droptarget: null, // onDrop callback return drop element | ||
owner: null // owner drop element of selectet draggable element | ||
} | ||
``` | ||
@@ -58,0 +67,0 @@ |
@@ -7,3 +7,4 @@ let VueDraggable = { | ||
multipleDropzonesItemsDraggingEnabled: true, | ||
onDrop: null | ||
onDrop: () => {}, | ||
onDragstart: () => {} | ||
}, | ||
@@ -204,2 +205,8 @@ targets: null, | ||
if (typeof this.defaultOptions.onDragstart === 'function') { | ||
this.defaultOptions.onDragstart(Object.assign({ | ||
nativeEvent: e | ||
}, this.selections)); | ||
} | ||
//[else] if the multiple selection modifier is pressed | ||
@@ -397,3 +404,5 @@ //and the item's grabbed state is currently false | ||
if (typeof this.defaultOptions.onDrop === 'function') { | ||
this.defaultOptions.onDrop(Object.assign({}, this.selections)); | ||
this.defaultOptions.onDrop(Object.assign({ | ||
nativeEvent: e | ||
}, this.selections)); | ||
} | ||
@@ -400,0 +409,0 @@ |
38411
832
137