11/**!
2- * Sortable 1.10.2
2+ * Sortable 1.13.0
33 * @author RubaXa <trash@rubaxa.org>
44 * @author owenm <owen23355@gmail.com>
55 * @license MIT
@@ -126,7 +126,7 @@ function _nonIterableSpread() {
126126 throw new TypeError ( "Invalid attempt to spread non-iterable instance" ) ;
127127}
128128
129- var version = "1.10.2 " ;
129+ var version = "1.13.0 " ;
130130
131131function userAgent ( pattern ) {
132132 if ( typeof window !== 'undefined' && window . navigator ) {
@@ -308,7 +308,7 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
308308 if ( ! el . getBoundingClientRect && el !== window ) return ;
309309 var elRect , top , left , bottom , right , height , width ;
310310
311- if ( el !== window && el !== getWindowScrollingElement ( ) ) {
311+ if ( el !== window && el . parentNode && el !== getWindowScrollingElement ( ) ) {
312312 elRect = el . getBoundingClientRect ( ) ;
313313 top = elRect . top ;
314314 left = elRect . left ;
@@ -748,7 +748,7 @@ function AnimationStateManager() {
748748 target . animatingX = ! ! translateX ;
749749 target . animatingY = ! ! translateY ;
750750 css ( target , 'transform' , 'translate3d(' + translateX + 'px,' + translateY + 'px,0)' ) ;
751- repaint ( target ) ; // repaint
751+ this . forRepaintDummy = repaint ( target ) ; // repaint
752752
753753 css ( target , 'transition' , 'transform ' + duration + 'ms' + ( this . options . easing ? ' ' + this . options . easing : '' ) ) ;
754754 css ( target , 'transform' , 'translate3d(0,0,0)' ) ;
@@ -786,6 +786,11 @@ var PluginManager = {
786786 }
787787 }
788788
789+ plugins . forEach ( function ( p ) {
790+ if ( p . pluginName === plugin . pluginName ) {
791+ throw "Sortable: Cannot mount plugin " . concat ( plugin . pluginName , " more than once" ) ;
792+ }
793+ } ) ;
789794 plugins . push ( plugin ) ;
790795 } ,
791796 pluginEvent : function pluginEvent ( eventName , sortable , evt ) {
@@ -1229,7 +1234,7 @@ function Sortable(el, options) {
12291234 x : 0 ,
12301235 y : 0
12311236 } ,
1232- supportPointer : Sortable . supportPointer !== false && 'PointerEvent' in window ,
1237+ supportPointer : Sortable . supportPointer !== false && 'PointerEvent' in window && ! Safari ,
12331238 emptyInsertThreshold : 5
12341239 } ;
12351240 PluginManager . initializePlugins ( this , el , defaults ) ; // Set default options
@@ -1316,6 +1321,11 @@ Sortable.prototype =
13161321
13171322 if ( originalTarget . isContentEditable ) {
13181323 return ;
1324+ } // Safari ignores further event handling after mousedown
1325+
1326+
1327+ if ( ! this . nativeDraggable && Safari && target && target . tagName . toUpperCase ( ) === 'SELECT' ) {
1328+ return ;
13191329 }
13201330
13211331 target = closest ( target , options . draggable , el , false ) ;
@@ -2313,7 +2323,7 @@ Sortable.prototype =
23132323 * Sorts the elements according to the array.
23142324 * @param {String[] } order order of the items
23152325 */
2316- sort : function sort ( order ) {
2326+ sort : function sort ( order , useAnimation ) {
23172327 var items = { } ,
23182328 rootEl = this . el ;
23192329 this . toArray ( ) . forEach ( function ( id , i ) {
@@ -2323,12 +2333,14 @@ Sortable.prototype =
23232333 items [ id ] = el ;
23242334 }
23252335 } , this ) ;
2336+ useAnimation && this . captureAnimationState ( ) ;
23262337 order . forEach ( function ( id ) {
23272338 if ( items [ id ] ) {
23282339 rootEl . removeChild ( items [ id ] ) ;
23292340 rootEl . appendChild ( items [ id ] ) ;
23302341 }
23312342 } ) ;
2343+ useAnimation && this . animateAll ( ) ;
23322344 } ,
23332345
23342346 /**
@@ -2427,7 +2439,7 @@ Sortable.prototype =
24272439 pluginEvent ( 'showClone' , this ) ;
24282440 if ( Sortable . eventCanceled ) return ; // show clone at dragEl or original position
24292441
2430- if ( rootEl . contains ( dragEl ) && ! this . options . group . revertClone ) {
2442+ if ( dragEl . parentNode == rootEl && ! this . options . group . revertClone ) {
24312443 rootEl . insertBefore ( cloneEl , dragEl ) ;
24322444 } else if ( nextEl ) {
24332445 rootEl . insertBefore ( cloneEl , nextEl ) ;
0 commit comments