22 * Copyright 2015 Drifty Co.
33 * http://drifty.com/
44 *
5- * Ionic, v1.2.1
5+ * Ionic, v1.2.2
66 * A powerful HTML5 mobile app framework.
77 * http://ionicframework.com/
88 *
@@ -2307,9 +2307,10 @@ function($ionicLoadingConfig, $ionicBody, $ionicTemplateLoader, $ionicBackdrop,
23072307 }
23082308 self . element . removeClass ( 'active' ) ;
23092309 $ionicBody . removeClass ( 'loading-active' ) ;
2310- setTimeout ( function ( ) {
2310+ self . element . removeClass ( 'visible' ) ;
2311+ ionic . requestAnimationFrame ( function ( ) {
23112312 ! self . isShown && self . element . removeClass ( 'visible' ) ;
2312- } , 200 ) ;
2313+ } ) ;
23132314 }
23142315 $timeout . cancel ( self . durationTimeout ) ;
23152316 self . isShown = false ;
@@ -2559,7 +2560,7 @@ function($rootScope, $ionicBody, $compile, $timeout, $ionicPlatform, $ionicTempl
25592560 self . $el . on ( 'touchmove' , function ( e ) {
25602561 //Don't allow scrolling while open by dragging on backdrop
25612562 var isInScroll = ionic . DomUtil . getParentOrSelfWithClass ( e . target , 'scroll' ) ;
2562- if ( ! isInScroll ) {
2563+ if ( ! isInScroll ) {
25632564 e . preventDefault ( ) ;
25642565 }
25652566 } ) ;
@@ -6825,6 +6826,15 @@ IonicModule
68256826 startY = Math . floor ( e . touches [ 0 ] . screenY ) ;
68266827 }
68276828
6829+ function handleTouchstart ( e ) {
6830+ e . touches = e . touches || [ {
6831+ screenX : e . screenX ,
6832+ screenY : e . screenY
6833+ } ] ;
6834+
6835+ startY = e . touches [ 0 ] . screenY ;
6836+ }
6837+
68286838 function handleTouchend ( ) {
68296839 // reset Y
68306840 startY = null ;
@@ -6861,7 +6871,7 @@ IonicModule
68616871 } ] ;
68626872
68636873 // Force mouse events to have had a down event first
6864- if ( ! startY && e . type == 'mousemove' ) {
6874+ if ( ! startY && e . type == 'mousemove' ) {
68656875 return ;
68666876 }
68676877
@@ -6874,14 +6884,16 @@ IonicModule
68746884 startY = e . touches [ 0 ] . screenY ;
68756885 }
68766886
6887+ deltaY = e . touches [ 0 ] . screenY - startY ;
6888+
6889+ // how far have we dragged so far?
68776890 // kitkat fix for touchcancel events http://updates.html5rocks.com/2014/05/A-More-Compatible-Smoother-Touch
6878- if ( ionic . Platform . isAndroid ( ) && ionic . Platform . version ( ) === 4.4 && scrollParent . scrollTop === 0 ) {
6891+ // Only do this if we're not on crosswalk
6892+ if ( ionic . Platform . isAndroid ( ) && ionic . Platform . version ( ) === 4.4 && ! ionic . Platform . isCrosswalk ( ) && scrollParent . scrollTop === 0 && deltaY > 0 ) {
68796893 isDragging = true ;
68806894 e . preventDefault ( ) ;
68816895 }
68826896
6883- // how far have we dragged so far?
6884- deltaY = e . touches [ 0 ] . screenY - startY ;
68856897
68866898 // if we've dragged up and back down in to native scroll territory
68876899 if ( deltaY - dragOffset <= 0 || scrollParent . scrollTop !== 0 ) {
@@ -7034,17 +7046,17 @@ IonicModule
70347046 }
70357047
70367048
7037- var touchMoveEvent , touchEndEvent ;
7049+ var touchStartEvent , touchMoveEvent , touchEndEvent ;
70387050 if ( window . navigator . pointerEnabled ) {
7039- // touchStartEvent = 'pointerdown';
7051+ touchStartEvent = 'pointerdown' ;
70407052 touchMoveEvent = 'pointermove' ;
70417053 touchEndEvent = 'pointerup' ;
70427054 } else if ( window . navigator . msPointerEnabled ) {
7043- // touchStartEvent = 'MSPointerDown';
7055+ touchStartEvent = 'MSPointerDown' ;
70447056 touchMoveEvent = 'MSPointerMove' ;
70457057 touchEndEvent = 'MSPointerUp' ;
70467058 } else {
7047- // touchStartEvent = 'touchstart';
7059+ touchStartEvent = 'touchstart' ;
70487060 touchMoveEvent = 'touchmove' ;
70497061 touchEndEvent = 'touchend' ;
70507062 }
@@ -7059,6 +7071,7 @@ IonicModule
70597071 }
70607072
70617073
7074+ ionic . on ( touchStartEvent , handleTouchstart , scrollChild ) ;
70627075 ionic . on ( touchMoveEvent , handleTouchmove , scrollChild ) ;
70637076 ionic . on ( touchEndEvent , handleTouchend , scrollChild ) ;
70647077 ionic . on ( 'mousedown' , handleMousedown , scrollChild ) ;
@@ -7071,6 +7084,7 @@ IonicModule
70717084 } ;
70727085
70737086 function destroy ( ) {
7087+ ionic . off ( touchStartEvent , handleTouchstart , scrollChild ) ;
70747088 ionic . off ( touchMoveEvent , handleTouchmove , scrollChild ) ;
70757089 ionic . off ( touchEndEvent , handleTouchend , scrollChild ) ;
70767090 ionic . off ( 'mousedown' , handleMousedown , scrollChild ) ;
@@ -7328,6 +7342,7 @@ function($scope,
73287342 } ;
73297343
73307344 self . freezeScroll = scrollView . freeze ;
7345+ self . freezeScrollShut = scrollView . freezeShut ;
73317346
73327347 self . freezeAllScrolls = function ( shouldFreeze ) {
73337348 for ( var i = 0 ; i < $ionicScrollDelegate . _instances . length ; i ++ ) {
@@ -7509,9 +7524,10 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
75097524 // equal 0, otherwise remove the class from the body element
75107525 $ionicBody . enableClass ( ( percentage !== 0 ) , 'menu-open' ) ;
75117526
7512- freezeAllScrolls ( false ) ;
7527+ self . content . setCanScroll ( percentage == 0 ) ;
75137528 } ;
75147529
7530+ /*
75157531 function freezeAllScrolls(shouldFreeze) {
75167532 if (shouldFreeze && !self.isScrollFreeze) {
75177533 $ionicScrollDelegate.freezeAllScrolls(shouldFreeze);
@@ -7521,6 +7537,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
75217537 }
75227538 self.isScrollFreeze = shouldFreeze;
75237539 }
7540+ */
75247541
75257542 /**
75267543 * Open the menu the given pixel amount.
@@ -7654,7 +7671,6 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
76547671
76557672 isAsideExposed = shouldExposeAside ;
76567673 if ( ( self . left && self . left . isEnabled ) && ( self . right && self . right . isEnabled ) ) {
7657- void 0 ;
76587674 self . content . setMarginLeftAndRight ( isAsideExposed ? self . left . width : 0 , isAsideExposed ? self . right . width : 0 ) ;
76597675 } else if ( self . left && self . left . isEnabled ) {
76607676 // set the left marget width if it should be exposed
@@ -7672,8 +7688,6 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
76727688
76737689 // End a drag with the given event
76747690 self . _endDrag = function ( e ) {
7675- freezeAllScrolls ( false ) ;
7676-
76777691 if ( isAsideExposed ) return ;
76787692
76797693 if ( isDragging ) {
@@ -7711,7 +7725,7 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
77117725
77127726 if ( isDragging ) {
77137727 self . openAmount ( offsetX + ( lastX - startX ) ) ;
7714- freezeAllScrolls ( true ) ;
7728+ //self.content.setCanScroll(false );
77157729 }
77167730 } ;
77177731
@@ -7790,12 +7804,10 @@ function($scope, $attrs, $ionicSideMenuDelegate, $ionicPlatform, $ionicBody, $io
77907804 deregisterBackButtonAction ( ) ;
77917805 self . $scope = null ;
77927806 if ( self . content ) {
7807+ self . content . setCanScroll ( true ) ;
77937808 self . content . element = null ;
77947809 self . content = null ;
77957810 }
7796-
7797- // ensure scrolls are unfrozen
7798- freezeAllScrolls ( false ) ;
77997811 } ) ;
78007812
78017813 self . initialize ( {
@@ -9788,6 +9800,8 @@ function($timeout, $controller, $ionicBind, $ionicConfig) {
97889800 scrollViewOptions : scrollViewOptions
97899801 } ) ;
97909802
9803+ $scope . scrollCtrl = scrollCtrl ;
9804+
97919805 $scope . $on ( '$destroy' , function ( ) {
97929806 if ( scrollViewOptions ) {
97939807 scrollViewOptions . scrollingComplete = noop ;
@@ -12610,6 +12624,22 @@ function($timeout, $ionicGesture, $window) {
1261012624 element : element [ 0 ] ,
1261112625 onDrag : function ( ) { } ,
1261212626 endDrag : function ( ) { } ,
12627+ setCanScroll : function ( canScroll ) {
12628+ var c = $element [ 0 ] . querySelector ( '.scroll' ) ;
12629+
12630+ if ( ! c ) {
12631+ return ;
12632+ }
12633+
12634+ var content = angular . element ( c . parentElement ) ;
12635+ if ( ! content ) {
12636+ return ;
12637+ }
12638+
12639+ // freeze our scroll container if we have one
12640+ var scrollScope = content . scope ( ) ;
12641+ scrollScope . scrollCtrl && scrollScope . scrollCtrl . freezeScrollShut ( ! canScroll ) ;
12642+ } ,
1261312643 getTranslateX : function ( ) {
1261412644 return $scope . sideMenuContentTranslateX || 0 ;
1261512645 } ,
@@ -12677,9 +12707,7 @@ function($timeout, $ionicGesture, $window) {
1267712707
1267812708 // add gesture handlers
1267912709 var gestureOpts = { stop_browser_behavior : false } ;
12680- if ( ionic . DomUtil . getParentOrSelfWithClass ( $element [ 0 ] , 'overflow-scroll' ) ) {
12681- gestureOpts . prevent_default_directions = [ 'left' , 'right' ] ;
12682- }
12710+ gestureOpts . prevent_default_directions = [ 'left' , 'right' ] ;
1268312711 var contentTapGesture = $ionicGesture . on ( 'tap' , onContentTap , $element , gestureOpts ) ;
1268412712 var dragRightGesture = $ionicGesture . on ( 'dragright' , onDragX , $element , gestureOpts ) ;
1268512713 var dragLeftGesture = $ionicGesture . on ( 'dragleft' , onDragX , $element , gestureOpts ) ;
@@ -13086,7 +13114,8 @@ IonicModule
1308613114. directive ( 'ionSlides' , [
1308713115 '$animate' ,
1308813116 '$timeout' ,
13089- function ( $animate , $timeout ) {
13117+ '$compile' ,
13118+ function ( $animate , $timeout , $compile ) {
1309013119 return {
1309113120 restrict : 'E' ,
1309213121 transclude : true ,
@@ -13104,6 +13133,10 @@ function($animate, $timeout) {
1310413133
1310513134 this . update = function ( ) {
1310613135 $timeout ( function ( ) {
13136+ if ( ! _this . __slider ) {
13137+ return ;
13138+ }
13139+
1310713140 _this . __slider . update ( ) ;
1310813141 if ( _this . _options . loop ) {
1310913142 _this . __slider . createLoop ( ) ;
@@ -13136,7 +13169,7 @@ function($animate, $timeout) {
1313613169 this . _options = newOptions ;
1313713170
1313813171 $timeout ( function ( ) {
13139- var slider = new ionic . views . Swiper ( $element . children ( ) [ 0 ] , newOptions , $scope ) ;
13172+ var slider = new ionic . views . Swiper ( $element . children ( ) [ 0 ] , newOptions , $scope , $compile ) ;
1314013173
1314113174 _this . __slider = slider ;
1314213175 $scope . slider = _this . __slider ;
@@ -13149,10 +13182,10 @@ function($animate, $timeout) {
1314913182 } ] ,
1315013183
1315113184
13152- link : function ( $scope , $element ) {
13185+ link : function ( $scope ) {
1315313186 $scope . showPager = true ;
1315413187 // Disable ngAnimate for slidebox and its children
13155- $animate . enabled ( false , $element ) ;
13188+ // $animate.enabled(false, $element);
1315613189 }
1315713190 } ;
1315813191} ] )
0 commit comments