Skip to content

Commit

Permalink
fix exclusion of items
Browse files Browse the repository at this point in the history
closes #66
  • Loading branch information
Jonas von Andrian authored and Jonas von Andrian committed Feb 19, 2014
1 parent c77bafd commit 828d4c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/js/jquery-sortable.js
Expand Up @@ -240,8 +240,10 @@
this.item = $(e.target).closest(this.options.itemSelector)
this.itemContainer = itemContainer

if(!this.options.onMousedown(this.item, groupDefaults.onMousedown, e))
if(this.item.is(this.options.exclude) ||
!this.options.onMousedown(this.item, groupDefaults.onMousedown, e)){
return
}

this.setPointer(e)
this.toggleListeners('on')
Expand Down Expand Up @@ -457,9 +459,9 @@

if( !rootGroup.dragInitDone &&
e.which === 1 &&
this.options.drag &&
!$(e.target).is(this.options.exclude))
this.options.drag) {
rootGroup.dragInit(e, this)
}
},
searchValidTarget: function (pointer, lastPointer) {
var distances = sortByDistanceDesc(this.getItemDimensions(),
Expand Down

0 comments on commit 828d4c1

Please sign in to comment.