Browse Source

+ dragend

pull/10/head
RubaXa 11 years ago
parent
commit
328baab4ed
  1. 13
      Sortable.js

13
Sortable.js

@ -137,6 +137,8 @@
_on(this.el, 'dragstart', this._onDragStart);
_on(this.el, 'dragend', this._onDrop);
_on(document, 'dragover', _globalDragOver);
@ -285,6 +287,7 @@
_off(document, 'drop', this._onDrop);
_off(document, 'dragover', _globalDragOver);
_off(this.el, 'dragend', this._onDrop);
_off(this.el, 'dragstart', this._onDragStart);
_off(document, 'touchmove', this._onTouchMove);
@ -294,6 +297,10 @@
if( evt ){
evt.preventDefault();
if( ghostEl ){
ghostEl.parentNode.removeChild(ghostEl);
}
if( dragEl ){
var opts = { bubbles: true, cancelable: true, detail: dragEl };
@ -312,10 +319,6 @@
}
}
if( ghostEl ){
ghostEl.parentNode.removeChild(ghostEl);
}
// Set NULL
rootEl =
@ -411,7 +414,7 @@
el.classList[state ? 'add' : 'remove'](name);
}
else {
var className = (' '+el.className+' ').replace(' '+name+' ', '').replace(/\s+/g, ' ');
var className = (' '+el.className+' ').replace(/\s+/g, ' ').replace(' '+name+' ', '');
el.className = className + (state ? ' '+name : '')
}
}

Loading…
Cancel
Save