Browse Source

* fixed #5 and #6

pull/10/head
RubaXa 11 years ago
parent
commit
682cd7effe
  1. 13
      Sortable.js
  2. 4
      Sortable.min.js
  3. 2
      package.json

13
Sortable.js

@ -119,15 +119,16 @@
touch = evt.touches && evt.touches[0] touch = evt.touches && evt.touches[0]
, target = (touch || evt).target , target = (touch || evt).target
, options = this.options , options = this.options
, el = this.el
; ;
if( options.handle ){ if( options.handle ){
target = _closest(target, options.handle, this.el); target = _closest(target, options.handle, el);
} }
target = _closest(target, options.draggable, this.el); target = _closest(target, options.draggable, el);
if( target && !dragEl ){ if( target && !dragEl && (target !== el) ){
tapEvt = evt; tapEvt = evt;
target.draggable = true; target.draggable = true;
@ -397,13 +398,13 @@
var var
tag = selector.shift().toUpperCase() tag = selector.shift().toUpperCase()
, re = new RegExp('\\b('+selector.join('|')+')\\b', 'g') , re = new RegExp('\\s('+selector.join('|')+')\\s', 'g')
; ;
do { do {
if( if(
(tag === '' || el.nodeName == tag) (tag === '' || el.nodeName == tag)
&& (!selector.length || ((el.className+'').match(re) || []).length == selector.length) && (!selector.length || ((' '+el.className+' ').match(re) || []).length == selector.length)
){ ){
return el; return el;
} }
@ -498,7 +499,7 @@
}; };
Sortable.version = '0.1.2'; Sortable.version = '0.1.3';
// Export // Export
return Sortable; return Sortable;

4
Sortable.min.js vendored

File diff suppressed because one or more lines are too long

2
package.json

@ -1,7 +1,7 @@
{ {
"name": "sortable", "name": "sortable",
"exportName": "Sortable", "exportName": "Sortable",
"version": "0.1.2", "version": "0.1.3",
"devDependencies": { "devDependencies": {
"grunt": "*", "grunt": "*",
"grunt-version": "*", "grunt-version": "*",

Loading…
Cancel
Save