@@ -7605,48 +7605,53 @@ var Slider =
76057605 e . preventDefault ( ) ;
76067606 } ,
76077607 swipeMove : function ( e ) {
7608- if ( this . state . dragging ) {
7609- var swipeLeft , swipeLength , swipeDirection ;
7610- var curLeft ;
7611- var touchObject = this . state . touchObject ;
7612-
7613- curLeft = this . getLeft ( this . state . currentSlide ) ;
7614- touchObject . curX = ( e . touches ) ? e . touches [ 0 ] . pageX : e . clientX ;
7615- touchObject . curY = ( e . touches ) ? e . touches [ 0 ] . pageY : e . clientY ;
7616- touchObject . swipeLength = Math . round ( Math . sqrt ( Math . pow ( touchObject . curX - touchObject . startX , 2 ) ) ) ;
7617-
7618- positionOffset = ( this . props . rtl === false ? 1 : - 1 ) * ( touchObject . curX > touchObject . startX ? 1 : - 1 ) ;
7619- swipeLeft = curLeft + touchObject . swipeLength * positionOffset ;
7620- this . setState ( {
7621- touchObject : touchObject ,
7622- swipeLeft : swipeLeft ,
7623- trackStyle : this . getCSS ( swipeLeft ) ,
7624- } ) ;
7608+ if ( ! this . state . dragging ) {
7609+ return ;
7610+ }
7611+ if ( this . state . animating ) {
7612+ return ;
76257613 }
7614+ var swipeLeft , swipeLength , swipeDirection ;
7615+ var curLeft ;
7616+ var touchObject = this . state . touchObject ;
7617+
7618+ curLeft = this . getLeft ( this . state . currentSlide ) ;
7619+ touchObject . curX = ( e . touches ) ? e . touches [ 0 ] . pageX : e . clientX ;
7620+ touchObject . curY = ( e . touches ) ? e . touches [ 0 ] . pageY : e . clientY ;
7621+ touchObject . swipeLength = Math . round ( Math . sqrt ( Math . pow ( touchObject . curX - touchObject . startX , 2 ) ) ) ;
7622+
7623+ positionOffset = ( this . props . rtl === false ? 1 : - 1 ) * ( touchObject . curX > touchObject . startX ? 1 : - 1 ) ;
7624+ swipeLeft = curLeft + touchObject . swipeLength * positionOffset ;
7625+ this . setState ( {
7626+ touchObject : touchObject ,
7627+ swipeLeft : swipeLeft ,
7628+ trackStyle : this . getCSS ( swipeLeft ) ,
7629+ } ) ;
76267630 e . preventDefault ( ) ;
76277631 } ,
76287632 swipeEnd : function ( e ) {
7629- if ( this . state . dragging ) {
7630- var touchObject = this . state . touchObject ;
7631- var minSwipe = this . state . listWidth / this . props . touchThreshold ;
7632- var swipeDirection = this . swipeDirection ( touchObject ) ;
7633- this . setState ( {
7634- dragging : false ,
7635- touchObject : { }
7636- } ) ;
7637- if ( touchObject . swipeLength > minSwipe ) {
7638- if ( swipeDirection === 'left' ) {
7639- this . slideHandler ( this . state . currentSlide + this . props . slidesToScroll ) ;
7640- } else if ( swipeDirection === 'right' ) {
7641- this . slideHandler ( this . state . currentSlide - this . props . slidesToScroll ) ;
7642- } else {
7643- this . slideHandler ( this . state . currentSlide , null , true ) ;
7644- }
7633+ if ( ! this . state . dragging ) {
7634+ return ;
7635+ }
7636+ var touchObject = this . state . touchObject ;
7637+ var minSwipe = this . state . listWidth / this . props . touchThreshold ;
7638+ var swipeDirection = this . swipeDirection ( touchObject ) ;
7639+ this . setState ( {
7640+ dragging : false ,
7641+ touchObject : { }
7642+ } ) ;
7643+ if ( touchObject . swipeLength > minSwipe ) {
7644+ if ( swipeDirection === 'left' ) {
7645+ this . slideHandler ( this . state . currentSlide + this . props . slidesToScroll ) ;
7646+ } else if ( swipeDirection === 'right' ) {
7647+ this . slideHandler ( this . state . currentSlide - this . props . slidesToScroll ) ;
76457648 } else {
76467649 this . slideHandler ( this . state . currentSlide , null , true ) ;
76477650 }
7648- e . preventDefault ( ) ;
7651+ } else {
7652+ this . slideHandler ( this . state . currentSlide , null , true ) ;
76497653 }
7654+ e . preventDefault ( ) ;
76507655 } ,
76517656 } ;
76527657
@@ -8607,8 +8612,8 @@ var Slider =
86078612
86088613 "use strict" ;
86098614
8610- var ReactContext = __webpack_require__ ( 24 ) ;
8611- var ReactCurrentOwner = __webpack_require__ ( 25 ) ;
8615+ var ReactContext = __webpack_require__ ( 28 ) ;
8616+ var ReactCurrentOwner = __webpack_require__ ( 29 ) ;
86128617
86138618 var warning = __webpack_require__ ( 22 ) ;
86148619
@@ -8855,10 +8860,10 @@ var Slider =
88558860
88568861 "use strict" ;
88578862
8858- var assign = __webpack_require__ ( 26 ) ;
8859- var emptyFunction = __webpack_require__ ( 27 ) ;
8860- var invariant = __webpack_require__ ( 28 ) ;
8861- var joinClasses = __webpack_require__ ( 29 ) ;
8863+ var assign = __webpack_require__ ( 24 ) ;
8864+ var emptyFunction = __webpack_require__ ( 25 ) ;
8865+ var invariant = __webpack_require__ ( 26 ) ;
8866+ var joinClasses = __webpack_require__ ( 27 ) ;
88628867 var warning = __webpack_require__ ( 22 ) ;
88638868
88648869 var didWarn = false ;
@@ -9064,7 +9069,7 @@ var Slider =
90649069
90659070 "use strict" ;
90669071
9067- var emptyFunction = __webpack_require__ ( 27 ) ;
9072+ var emptyFunction = __webpack_require__ ( 25 ) ;
90689073
90699074 /**
90709075 * Similar to invariant but only logs a warning if the condition is not met.
@@ -9145,110 +9150,6 @@ var Slider =
91459150
91469151/***/ } ,
91479152/* 24 */
9148- /***/ function ( module , exports , __webpack_require__ ) {
9149-
9150- /**
9151- * Copyright 2013-2014, Facebook, Inc.
9152- * All rights reserved.
9153- *
9154- * This source code is licensed under the BSD-style license found in the
9155- * LICENSE file in the root directory of this source tree. An additional grant
9156- * of patent rights can be found in the PATENTS file in the same directory.
9157- *
9158- * @providesModule ReactContext
9159- */
9160-
9161- "use strict" ;
9162-
9163- var assign = __webpack_require__ ( 26 ) ;
9164-
9165- /**
9166- * Keeps track of the current context.
9167- *
9168- * The context is automatically passed down the component ownership hierarchy
9169- * and is accessible via `this.context` on ReactCompositeComponents.
9170- */
9171- var ReactContext = {
9172-
9173- /**
9174- * @internal
9175- * @type {object }
9176- */
9177- current : { } ,
9178-
9179- /**
9180- * Temporarily extends the current context while executing scopedCallback.
9181- *
9182- * A typical use case might look like
9183- *
9184- * render: function() {
9185- * var children = ReactContext.withContext({foo: 'foo'}, () => (
9186- *
9187- * ));
9188- * return <div>{children}</div>;
9189- * }
9190- *
9191- * @param {object } newContext New context to merge into the existing context
9192- * @param {function } scopedCallback Callback to run with the new context
9193- * @return {ReactComponent|array<ReactComponent> }
9194- */
9195- withContext : function ( newContext , scopedCallback ) {
9196- var result ;
9197- var previousContext = ReactContext . current ;
9198- ReactContext . current = assign ( { } , previousContext , newContext ) ;
9199- try {
9200- result = scopedCallback ( ) ;
9201- } finally {
9202- ReactContext . current = previousContext ;
9203- }
9204- return result ;
9205- }
9206-
9207- } ;
9208-
9209- module . exports = ReactContext ;
9210-
9211-
9212- /***/ } ,
9213- /* 25 */
9214- /***/ function ( module , exports , __webpack_require__ ) {
9215-
9216- /**
9217- * Copyright 2013-2014, Facebook, Inc.
9218- * All rights reserved.
9219- *
9220- * This source code is licensed under the BSD-style license found in the
9221- * LICENSE file in the root directory of this source tree. An additional grant
9222- * of patent rights can be found in the PATENTS file in the same directory.
9223- *
9224- * @providesModule ReactCurrentOwner
9225- */
9226-
9227- "use strict" ;
9228-
9229- /**
9230- * Keeps track of the current owner.
9231- *
9232- * The current owner is the component who should own any components that are
9233- * currently being constructed.
9234- *
9235- * The depth indicate how many composite components are above this render level.
9236- */
9237- var ReactCurrentOwner = {
9238-
9239- /**
9240- * @internal
9241- * @type {ReactComponent }
9242- */
9243- current : null
9244-
9245- } ;
9246-
9247- module . exports = ReactCurrentOwner ;
9248-
9249-
9250- /***/ } ,
9251- /* 26 */
92529153/***/ function ( module , exports , __webpack_require__ ) {
92539154
92549155 /**
@@ -9299,7 +9200,7 @@ var Slider =
92999200
93009201
93019202/***/ } ,
9302- /* 27 */
9203+ /* 25 */
93039204/***/ function ( module , exports , __webpack_require__ ) {
93049205
93059206 /**
@@ -9337,7 +9238,7 @@ var Slider =
93379238
93389239
93399240/***/ } ,
9340- /* 28 */
9241+ /* 26 */
93419242/***/ function ( module , exports , __webpack_require__ ) {
93429243
93439244 /**
@@ -9396,7 +9297,7 @@ var Slider =
93969297
93979298
93989299/***/ } ,
9399- /* 29 */
9300+ /* 27 */
94009301/***/ function ( module , exports , __webpack_require__ ) {
94019302
94029303 /**
@@ -9440,6 +9341,110 @@ var Slider =
94409341 module . exports = joinClasses ;
94419342
94429343
9344+ /***/ } ,
9345+ /* 28 */
9346+ /***/ function ( module , exports , __webpack_require__ ) {
9347+
9348+ /**
9349+ * Copyright 2013-2014, Facebook, Inc.
9350+ * All rights reserved.
9351+ *
9352+ * This source code is licensed under the BSD-style license found in the
9353+ * LICENSE file in the root directory of this source tree. An additional grant
9354+ * of patent rights can be found in the PATENTS file in the same directory.
9355+ *
9356+ * @providesModule ReactContext
9357+ */
9358+
9359+ "use strict" ;
9360+
9361+ var assign = __webpack_require__ ( 24 ) ;
9362+
9363+ /**
9364+ * Keeps track of the current context.
9365+ *
9366+ * The context is automatically passed down the component ownership hierarchy
9367+ * and is accessible via `this.context` on ReactCompositeComponents.
9368+ */
9369+ var ReactContext = {
9370+
9371+ /**
9372+ * @internal
9373+ * @type {object }
9374+ */
9375+ current : { } ,
9376+
9377+ /**
9378+ * Temporarily extends the current context while executing scopedCallback.
9379+ *
9380+ * A typical use case might look like
9381+ *
9382+ * render: function() {
9383+ * var children = ReactContext.withContext({foo: 'foo'}, () => (
9384+ *
9385+ * ));
9386+ * return <div>{children}</div>;
9387+ * }
9388+ *
9389+ * @param {object } newContext New context to merge into the existing context
9390+ * @param {function } scopedCallback Callback to run with the new context
9391+ * @return {ReactComponent|array<ReactComponent> }
9392+ */
9393+ withContext : function ( newContext , scopedCallback ) {
9394+ var result ;
9395+ var previousContext = ReactContext . current ;
9396+ ReactContext . current = assign ( { } , previousContext , newContext ) ;
9397+ try {
9398+ result = scopedCallback ( ) ;
9399+ } finally {
9400+ ReactContext . current = previousContext ;
9401+ }
9402+ return result ;
9403+ }
9404+
9405+ } ;
9406+
9407+ module . exports = ReactContext ;
9408+
9409+
9410+ /***/ } ,
9411+ /* 29 */
9412+ /***/ function ( module , exports , __webpack_require__ ) {
9413+
9414+ /**
9415+ * Copyright 2013-2014, Facebook, Inc.
9416+ * All rights reserved.
9417+ *
9418+ * This source code is licensed under the BSD-style license found in the
9419+ * LICENSE file in the root directory of this source tree. An additional grant
9420+ * of patent rights can be found in the PATENTS file in the same directory.
9421+ *
9422+ * @providesModule ReactCurrentOwner
9423+ */
9424+
9425+ "use strict" ;
9426+
9427+ /**
9428+ * Keeps track of the current owner.
9429+ *
9430+ * The current owner is the component who should own any components that are
9431+ * currently being constructed.
9432+ *
9433+ * The depth indicate how many composite components are above this render level.
9434+ */
9435+ var ReactCurrentOwner = {
9436+
9437+ /**
9438+ * @internal
9439+ * @type {ReactComponent }
9440+ */
9441+ current : null
9442+
9443+ } ;
9444+
9445+ module . exports = ReactCurrentOwner ;
9446+
9447+
94439448/***/ } ,
94449449/* 30 */
94459450/***/ function ( module , exports , __webpack_require__ ) {
0 commit comments