Permalink
Browse files

fix exclusion of items

closes #66
  • Loading branch information...
1 parent c77bafd commit 828d4c145c4ea1d2f5ba1a949f9d708c7e0f2f86 Jonas von Andrian committed Feb 19, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 source/js/jquery-sortable.js
View
8 source/js/jquery-sortable.js
@@ -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')
@@ -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(),

0 comments on commit 828d4c1

Please sign in to comment.