Browse Source

Merge pull request #17 from rudasn/destroy-unbind

unbind all element events on destroy
pull/29/head
Lebedev Konstantin 11 years ago
parent
commit
890ee5e4ed
  1. 4
      Sortable.js
  2. 2
      Sortable.min.js

4
Sortable.js

@ -134,7 +134,7 @@
target.dragDrop(); target.dragDrop();
} }
} }
if( target && !dragEl && (target.parentNode === el) ){ if( target && !dragEl && (target.parentNode === el) ){
tapEvt = evt; tapEvt = evt;
target.draggable = true; target.draggable = true;
@ -330,6 +330,7 @@
_off(this.el, 'dragend', this._onDrop); _off(this.el, 'dragend', this._onDrop);
_off(this.el, 'dragstart', this._onDragStart); _off(this.el, 'dragstart', this._onDragStart);
_off(this.el, 'selectstart', this._onTapStart);
_off(document, 'touchmove', this._onTouchMove); _off(document, 'touchmove', this._onTouchMove);
_off(document, 'touchend', this._onDrop); _off(document, 'touchend', this._onDrop);
@ -385,6 +386,7 @@
_off(el, 'mousedown', this._onTapStart); _off(el, 'mousedown', this._onTapStart);
_off(el, 'touchstart', this._onTapStart); _off(el, 'touchstart', this._onTapStart);
_off(el, 'selectstart', this._onTapStart);
_off(el, 'dragover', this._onDragOver); _off(el, 'dragover', this._onDragOver);
_off(el, 'dragenter', this._onDragOver); _off(el, 'dragenter', this._onDragOver);

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save