-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/**! | ||
* Sortable 1.14.0 | ||
* Sortable 1.15.0 | ||
* @author RubaXa <[email protected]> | ||
* @author owenm <[email protected]> | ||
* @license MIT | ||
|
@@ -166,7 +166,7 @@ | |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
|
||
var version = "1.14.0"; | ||
var version = "1.15.0"; | ||
|
||
function userAgent(pattern) { | ||
if (typeof window !== 'undefined' && window.navigator) { | ||
|
@@ -1173,7 +1173,7 @@ | |
}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position | ||
|
||
|
||
if (documentExists) { | ||
if (documentExists && !ChromeForAndroid) { | ||
document.addEventListener('click', function (evt) { | ||
if (ignoreNextClick) { | ||
evt.preventDefault(); | ||
|
@@ -1792,6 +1792,7 @@ | |
|
||
if (!Sortable.eventCanceled) { | ||
cloneEl = clone(dragEl); | ||
cloneEl.removeAttribute("id"); | ||
cloneEl.draggable = false; | ||
cloneEl.style['will-change'] = ''; | ||
|
||
|
@@ -2033,7 +2034,14 @@ | |
|
||
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) { | ||
capture(); | ||
el.appendChild(dragEl); | ||
|
||
if (elLastChild && elLastChild.nextSibling) { | ||
// the last draggable element is not the last node | ||
el.insertBefore(dragEl, elLastChild.nextSibling); | ||
} else { | ||
el.appendChild(dragEl); | ||
} | ||
|
||
parentEl = el; // actualization | ||
|
||
changed(); | ||
|
@@ -3178,18 +3186,21 @@ | |
} | ||
} | ||
|
||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
if (!sortable.options.avoidImplicitDeselect) { | ||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
} | ||
} | ||
|
||
on(document, 'keydown', this._checkKeyDown); | ||
on(document, 'keyup', this._checkKeyUp); | ||
this.defaults = { | ||
selectedClass: 'sortable-selected', | ||
multiDragKey: null, | ||
avoidImplicitDeselect: false, | ||
setData: function setData(dataTransfer, dragEl) { | ||
var data = ''; | ||
|
||
|
@@ -3480,7 +3491,7 @@ | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); // Modifier activated, select from last to dragEl | ||
|
||
if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { | ||
|
@@ -3509,7 +3520,7 @@ | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: children[i], | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} | ||
|
@@ -3526,7 +3537,7 @@ | |
rootEl: rootEl, | ||
name: 'deselect', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} // Multi-drag drop | ||
|
@@ -3637,7 +3648,7 @@ | |
rootEl: this.sortable.el, | ||
name: 'deselect', | ||
targetEl: el, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
}, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/**! | ||
* Sortable 1.14.0 | ||
* Sortable 1.15.0 | ||
* @author RubaXa <[email protected]> | ||
* @author owenm <[email protected]> | ||
* @license MIT | ||
|
@@ -160,7 +160,7 @@ function _nonIterableSpread() { | |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
|
||
var version = "1.14.0"; | ||
var version = "1.15.0"; | ||
|
||
function userAgent(pattern) { | ||
if (typeof window !== 'undefined' && window.navigator) { | ||
|
@@ -1167,7 +1167,7 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { | |
}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position | ||
|
||
|
||
if (documentExists) { | ||
if (documentExists && !ChromeForAndroid) { | ||
document.addEventListener('click', function (evt) { | ||
if (ignoreNextClick) { | ||
evt.preventDefault(); | ||
|
@@ -1786,6 +1786,7 @@ Sortable.prototype = | |
|
||
if (!Sortable.eventCanceled) { | ||
cloneEl = clone(dragEl); | ||
cloneEl.removeAttribute("id"); | ||
cloneEl.draggable = false; | ||
cloneEl.style['will-change'] = ''; | ||
|
||
|
@@ -2027,7 +2028,14 @@ Sortable.prototype = | |
|
||
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) { | ||
capture(); | ||
el.appendChild(dragEl); | ||
|
||
if (elLastChild && elLastChild.nextSibling) { | ||
// the last draggable element is not the last node | ||
el.insertBefore(dragEl, elLastChild.nextSibling); | ||
} else { | ||
el.appendChild(dragEl); | ||
} | ||
|
||
parentEl = el; // actualization | ||
|
||
changed(); | ||
|
@@ -3172,18 +3180,21 @@ function MultiDragPlugin() { | |
} | ||
} | ||
|
||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
if (!sortable.options.avoidImplicitDeselect) { | ||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
} | ||
} | ||
|
||
on(document, 'keydown', this._checkKeyDown); | ||
on(document, 'keyup', this._checkKeyUp); | ||
this.defaults = { | ||
selectedClass: 'sortable-selected', | ||
multiDragKey: null, | ||
avoidImplicitDeselect: false, | ||
setData: function setData(dataTransfer, dragEl) { | ||
var data = ''; | ||
|
||
|
@@ -3474,7 +3485,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); // Modifier activated, select from last to dragEl | ||
|
||
if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { | ||
|
@@ -3503,7 +3514,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: children[i], | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} | ||
|
@@ -3520,7 +3531,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'deselect', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} // Multi-drag drop | ||
|
@@ -3631,7 +3642,7 @@ function MultiDragPlugin() { | |
rootEl: this.sortable.el, | ||
name: 'deselect', | ||
targetEl: el, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/**! | ||
* Sortable 1.14.0 | ||
* Sortable 1.15.0 | ||
* @author RubaXa <[email protected]> | ||
* @author owenm <[email protected]> | ||
* @license MIT | ||
|
@@ -160,7 +160,7 @@ function _nonIterableSpread() { | |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
|
||
var version = "1.14.0"; | ||
var version = "1.15.0"; | ||
|
||
function userAgent(pattern) { | ||
if (typeof window !== 'undefined' && window.navigator) { | ||
|
@@ -1167,7 +1167,7 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { | |
}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position | ||
|
||
|
||
if (documentExists) { | ||
if (documentExists && !ChromeForAndroid) { | ||
document.addEventListener('click', function (evt) { | ||
if (ignoreNextClick) { | ||
evt.preventDefault(); | ||
|
@@ -1786,6 +1786,7 @@ Sortable.prototype = | |
|
||
if (!Sortable.eventCanceled) { | ||
cloneEl = clone(dragEl); | ||
cloneEl.removeAttribute("id"); | ||
cloneEl.draggable = false; | ||
cloneEl.style['will-change'] = ''; | ||
|
||
|
@@ -2027,7 +2028,14 @@ Sortable.prototype = | |
|
||
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) { | ||
capture(); | ||
el.appendChild(dragEl); | ||
|
||
if (elLastChild && elLastChild.nextSibling) { | ||
// the last draggable element is not the last node | ||
el.insertBefore(dragEl, elLastChild.nextSibling); | ||
} else { | ||
el.appendChild(dragEl); | ||
} | ||
|
||
parentEl = el; // actualization | ||
|
||
changed(); | ||
|
@@ -3174,18 +3182,21 @@ function MultiDragPlugin() { | |
} | ||
} | ||
|
||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
if (!sortable.options.avoidImplicitDeselect) { | ||
if (sortable.options.supportPointer) { | ||
on(document, 'pointerup', this._deselectMultiDrag); | ||
} else { | ||
on(document, 'mouseup', this._deselectMultiDrag); | ||
on(document, 'touchend', this._deselectMultiDrag); | ||
} | ||
} | ||
|
||
on(document, 'keydown', this._checkKeyDown); | ||
on(document, 'keyup', this._checkKeyUp); | ||
this.defaults = { | ||
selectedClass: 'sortable-selected', | ||
multiDragKey: null, | ||
avoidImplicitDeselect: false, | ||
setData: function setData(dataTransfer, dragEl) { | ||
var data = ''; | ||
|
||
|
@@ -3476,7 +3487,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); // Modifier activated, select from last to dragEl | ||
|
||
if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { | ||
|
@@ -3505,7 +3516,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'select', | ||
targetEl: children[i], | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} | ||
|
@@ -3522,7 +3533,7 @@ function MultiDragPlugin() { | |
rootEl: rootEl, | ||
name: 'deselect', | ||
targetEl: dragEl$1, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
} // Multi-drag drop | ||
|
@@ -3633,7 +3644,7 @@ function MultiDragPlugin() { | |
rootEl: this.sortable.el, | ||
name: 'deselect', | ||
targetEl: el, | ||
originalEvt: evt | ||
originalEvent: evt | ||
}); | ||
} | ||
}, | ||
|
Oops, something went wrong.
babf6ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
babf6ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I have a problem. sortable component failed when I set zoom property for 'body'. Is there any solution ?