Skip to content

Commit b88f851

Browse files
committed
do not stop propagation on drag init
see johnny#17
1 parent 5388ae9 commit b88f851

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

source/js/jquery-sortable.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@
237237
this.setPointer(e)
238238
},
239239
drag: function (e) {
240-
e.preventDefault()
241-
242240
if(!this.dragging){
243241
if(!this.distanceMet(e))
244242
return
@@ -266,7 +264,6 @@
266264
this.placeholder.detach()
267265
},
268266
drop: function (e) {
269-
e.preventDefault()
270267
this.toggleListeners('off')
271268

272269
if(!this.dragging)
@@ -286,6 +283,7 @@
286283
this.clearOffsetParent()
287284
this.lastAppendedItem = this.sameResultBox = undefined
288285
this.dragging = false
286+
this.item = undefined
289287
},
290288
searchValidTarget: function (pointer, lastPointer) {
291289
if(!pointer){
@@ -426,15 +424,16 @@
426424

427425
Container.prototype = {
428426
dragInit: function (e) {
429-
if(e.which !== 1 ||
427+
var rootGroup = this.rootGroup
428+
if(rootGroup.item ||
429+
e.which !== 1 ||
430430
!this.options.drag ||
431431
$(e.target).is(this.options.exclude))
432432
return;
433-
433+
434434
e.preventDefault()
435-
e.stopPropagation()
436435

437-
this.rootGroup.dragInit(e, this)
436+
rootGroup.dragInit(e, this)
438437
},
439438
searchValidTarget: function (pointer, lastPointer) {
440439
var distances = sortByDistanceDesc(this.getItemDimensions(),

0 commit comments

Comments
 (0)