Permalink
Browse files

dragInit event handler respects itemPath

closes #29
  • Loading branch information...
1 parent b5defe9 commit 6e6f14b7733652d160fdaeaf0830309564ff57be @johnny committed Aug 29, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 source/js/jquery-sortable.js
@@ -414,11 +414,14 @@
this.options = $.extend( {}, containerDefaults, options)
this.group = ContainerGroup.get(this.options)
- this.rootGroup = this.options.rootGroup = this.options.rootGroup || this.group
+ this.rootGroup = this.options.rootGroup || this.group
this.parentContainer = this.options.parentContainer
this.handle = this.rootGroup.options.handle || this.rootGroup.options.itemSelector
- this.el.on(eventNames.start, this.handle, $.proxy(this.dragInit, this))
+ var itemPath = this.rootGroup.options.itemPath,
+ target = itemPath ? this.el.find(itemPath) : this.el
+
+ target.on(eventNames.start, this.handle, $.proxy(this.dragInit, this))
if(this.options.drop)
this.group.containers.push(this)

0 comments on commit 6e6f14b

Please sign in to comment.