|
|
@ -70,6 +70,7 @@ |
|
|
|
Polymer = win.Polymer, |
|
|
|
Polymer = win.Polymer, |
|
|
|
|
|
|
|
|
|
|
|
captureMode = false, |
|
|
|
captureMode = false, |
|
|
|
|
|
|
|
passiveMode = false, |
|
|
|
|
|
|
|
|
|
|
|
supportDraggable = ('draggable' in document.createElement('div')), |
|
|
|
supportDraggable = ('draggable' in document.createElement('div')), |
|
|
|
supportCssPointerEvents = (function (el) { |
|
|
|
supportCssPointerEvents = (function (el) { |
|
|
@ -215,6 +216,18 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Detect support a passive mode
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
window.addEventListener('test', null, Object.defineProperty({}, 'passive', { |
|
|
|
|
|
|
|
get: function () { |
|
|
|
|
|
|
|
passiveMode = true; |
|
|
|
|
|
|
|
captureMode = { |
|
|
|
|
|
|
|
capture: false, |
|
|
|
|
|
|
|
passive: passiveMode |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
} catch (err) {} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @class Sortable |
|
|
|
* @class Sortable |
|
|
@ -681,7 +694,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
// #1143: Бывает элемент с IFrame внутри блокирует `drop`,
|
|
|
|
// #1143: Бывает элемент с IFrame внутри блокирует `drop`,
|
|
|
|
// поэтому если вызвался `mouseover`, значит надо отменять весь d'n'd.
|
|
|
|
// поэтому если вызвался `mouseover`, значит надо отменять весь d'n'd.
|
|
|
|
_on(document, 'mouseover', _this); |
|
|
|
// Breaking Chrome 62+
|
|
|
|
|
|
|
|
// _on(document, 'mouseover', _this);
|
|
|
|
|
|
|
|
|
|
|
|
_this._dragStartId = _nextTick(_this._dragStarted); |
|
|
|
_this._dragStartId = _nextTick(_this._dragStarted); |
|
|
|
} |
|
|
|
} |
|
|
@ -701,7 +715,7 @@ |
|
|
|
canSort = options.sort; |
|
|
|
canSort = options.sort; |
|
|
|
|
|
|
|
|
|
|
|
if (evt.preventDefault !== void 0) { |
|
|
|
if (evt.preventDefault !== void 0) { |
|
|
|
evt.preventDefault(); |
|
|
|
!passiveMode && evt.preventDefault(); |
|
|
|
!options.dragoverBubble && evt.stopPropagation(); |
|
|
|
!options.dragoverBubble && evt.stopPropagation(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -914,7 +928,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
if (evt) { |
|
|
|
if (evt) { |
|
|
|
if (moved) { |
|
|
|
if (moved) { |
|
|
|
evt.preventDefault(); |
|
|
|
!passiveMode && evt.preventDefault(); |
|
|
|
!options.dropBubble && evt.stopPropagation(); |
|
|
|
!options.dropBubble && evt.stopPropagation(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1213,7 +1227,7 @@ |
|
|
|
if (evt.dataTransfer) { |
|
|
|
if (evt.dataTransfer) { |
|
|
|
evt.dataTransfer.dropEffect = 'move'; |
|
|
|
evt.dataTransfer.dropEffect = 'move'; |
|
|
|
} |
|
|
|
} |
|
|
|
evt.preventDefault(); |
|
|
|
!passiveMode && evt.preventDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1484,17 +1498,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
window.addEventListener('test', null, Object.defineProperty({}, 'passive', { |
|
|
|
|
|
|
|
get: function () { |
|
|
|
|
|
|
|
captureMode = { |
|
|
|
|
|
|
|
capture: false, |
|
|
|
|
|
|
|
passive: false |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
} catch (err) {} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Export utils
|
|
|
|
// Export utils
|
|
|
|
Sortable.utils = { |
|
|
|
Sortable.utils = { |
|
|
|
on: _on, |
|
|
|
on: _on, |
|
|
|