|
|
@ -25,6 +25,7 @@ |
|
|
|
"use strict"; |
|
|
|
"use strict"; |
|
|
|
|
|
|
|
|
|
|
|
var dragEl, |
|
|
|
var dragEl, |
|
|
|
|
|
|
|
parentEl, |
|
|
|
ghostEl, |
|
|
|
ghostEl, |
|
|
|
cloneEl, |
|
|
|
cloneEl, |
|
|
|
rootEl, |
|
|
|
rootEl, |
|
|
@ -303,6 +304,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
rootEl = el; |
|
|
|
rootEl = el; |
|
|
|
dragEl = target; |
|
|
|
dragEl = target; |
|
|
|
|
|
|
|
parentEl = target.parentNode; |
|
|
|
nextEl = dragEl.nextSibling; |
|
|
|
nextEl = dragEl.nextSibling; |
|
|
|
activeGroup = options.group; |
|
|
|
activeGroup = options.group; |
|
|
|
|
|
|
|
|
|
|
@ -434,7 +436,7 @@ |
|
|
|
_onTouchMove: function (/**TouchEvent*/evt) { |
|
|
|
_onTouchMove: function (/**TouchEvent*/evt) { |
|
|
|
if (tapEvt) { |
|
|
|
if (tapEvt) { |
|
|
|
// only set the status to dragging, when we are actually dragging
|
|
|
|
// only set the status to dragging, when we are actually dragging
|
|
|
|
if(!Sortable.active) { |
|
|
|
if (!Sortable.active) { |
|
|
|
this._dragStarted(); |
|
|
|
this._dragStarted(); |
|
|
|
} |
|
|
|
} |
|
|
|
// as well as creating the ghost element on the document body
|
|
|
|
// as well as creating the ghost element on the document body
|
|
|
@ -457,8 +459,8 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_appendGhost: function() { |
|
|
|
_appendGhost: function () { |
|
|
|
if(!ghostEl) { |
|
|
|
if (!ghostEl) { |
|
|
|
var rect = dragEl.getBoundingClientRect(), |
|
|
|
var rect = dragEl.getBoundingClientRect(), |
|
|
|
css = _css(dragEl), |
|
|
|
css = _css(dragEl), |
|
|
|
ghostRect; |
|
|
|
ghostRect; |
|
|
@ -691,7 +693,7 @@ |
|
|
|
this._offUpEvents(); |
|
|
|
this._offUpEvents(); |
|
|
|
|
|
|
|
|
|
|
|
if (evt) { |
|
|
|
if (evt) { |
|
|
|
if(moved) { |
|
|
|
if (moved) { |
|
|
|
evt.preventDefault(); |
|
|
|
evt.preventDefault(); |
|
|
|
!options.dropBubble && evt.stopPropagation(); |
|
|
|
!options.dropBubble && evt.stopPropagation(); |
|
|
|
} |
|
|
|
} |
|
|
@ -703,15 +705,15 @@ |
|
|
|
_disableDraggable(dragEl); |
|
|
|
_disableDraggable(dragEl); |
|
|
|
_toggleClass(dragEl, this.options.ghostClass, false); |
|
|
|
_toggleClass(dragEl, this.options.ghostClass, false); |
|
|
|
|
|
|
|
|
|
|
|
if (rootEl !== dragEl.parentNode) { |
|
|
|
if (rootEl !== parentEl) { |
|
|
|
newIndex = _index(dragEl); |
|
|
|
newIndex = _index(dragEl); |
|
|
|
|
|
|
|
|
|
|
|
// drag from one list and drop into another
|
|
|
|
// drag from one list and drop into another
|
|
|
|
_dispatchEvent(null, dragEl.parentNode, 'sort', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
_dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
_dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
|
|
|
|
|
|
|
|
// Add event
|
|
|
|
// Add event
|
|
|
|
_dispatchEvent(null, dragEl.parentNode, 'add', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
|
|
|
|
|
|
|
|
// Remove event
|
|
|
|
// Remove event
|
|
|
|
_dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex); |
|
|
|
_dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex); |
|
|
@ -742,6 +744,7 @@ |
|
|
|
// Nulling
|
|
|
|
// Nulling
|
|
|
|
rootEl = |
|
|
|
rootEl = |
|
|
|
dragEl = |
|
|
|
dragEl = |
|
|
|
|
|
|
|
parentEl = |
|
|
|
ghostEl = |
|
|
|
ghostEl = |
|
|
|
nextEl = |
|
|
|
nextEl = |
|
|
|
cloneEl = |
|
|
|
cloneEl = |
|
|
@ -1149,7 +1152,7 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sortable.version = '1.2.1'; |
|
|
|
Sortable.version = '1.2.2'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|