Skip to content

Commit 6e6f14b

Browse files
committed
dragInit event handler respects itemPath
closes johnny#29
1 parent b5defe9 commit 6e6f14b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/js/jquery-sortable.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,14 @@
414414
this.options = $.extend( {}, containerDefaults, options)
415415

416416
this.group = ContainerGroup.get(this.options)
417-
this.rootGroup = this.options.rootGroup = this.options.rootGroup || this.group
417+
this.rootGroup = this.options.rootGroup || this.group
418418
this.parentContainer = this.options.parentContainer
419419
this.handle = this.rootGroup.options.handle || this.rootGroup.options.itemSelector
420420

421-
this.el.on(eventNames.start, this.handle, $.proxy(this.dragInit, this))
421+
var itemPath = this.rootGroup.options.itemPath,
422+
target = itemPath ? this.el.find(itemPath) : this.el
423+
424+
target.on(eventNames.start, this.handle, $.proxy(this.dragInit, this))
422425

423426
if(this.options.drop)
424427
this.group.containers.push(this)

0 commit comments

Comments
 (0)