@@ -291,13 +291,25 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
291
291
*/
292
292
self . showBackButton = function ( shouldShow ) {
293
293
var associatedNavBarCtrl = getAssociatedNavBarCtrl ( ) ;
294
- associatedNavBarCtrl && associatedNavBarCtrl . showActiveBackButton ( shouldShow ) ;
294
+ if ( associatedNavBarCtrl ) {
295
+ if ( arguments . length ) {
296
+ return associatedNavBarCtrl . showActiveBackButton ( shouldShow ) ;
297
+ }
298
+ return associatedNavBarCtrl . showActiveBackButton ( ) ;
299
+ }
300
+ return true ;
295
301
} ;
296
302
297
303
298
304
self . showBar = function ( val ) {
299
305
var associatedNavBarCtrl = getAssociatedNavBarCtrl ( ) ;
300
- associatedNavBarCtrl && associatedNavBarCtrl . showBar ( val ) ;
306
+ if ( associatedNavBarCtrl ) {
307
+ if ( arguments . length ) {
308
+ return associatedNavBarCtrl . showBar ( val ) ;
309
+ }
310
+ return associatedNavBarCtrl . showBar ( ) ;
311
+ }
312
+ return true ;
301
313
} ;
302
314
303
315
@@ -322,6 +334,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
322
334
var viewTransition , associatedNavBarCtrl , backView ;
323
335
var deregDragStart , deregDrag , deregRelease ;
324
336
var windowWidth , startDragX , dragPoints ;
337
+ var cancelData = { } ;
325
338
326
339
function onDragStart ( ev ) {
327
340
if ( ! isPrimary ) return ;
@@ -343,6 +356,11 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
343
356
344
357
dragPoints = [ ] ;
345
358
359
+ cancelData = {
360
+ showBar : self . showBar ( ) ,
361
+ showBackButton : self . showBackButton ( )
362
+ } ;
363
+
346
364
var switcher = $ionicViewSwitcher . create ( self , registerData , backView , $ionicHistory . currentView ( ) , true , false ) ;
347
365
switcher . loadViewElements ( registerData ) ;
348
366
switcher . render ( registerData ) ;
@@ -399,16 +417,18 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
399
417
disableAnimation = ( releaseSwipeCompletion < 0.03 || releaseSwipeCompletion > 0.97 ) ;
400
418
401
419
if ( isSwipingRight && ( releaseSwipeCompletion > 0.5 || velocity > 0.1 ) ) {
420
+ // complete view transition on release
402
421
var speed = ( velocity > 0.5 || velocity < 0.05 || releaseX > windowWidth - 45 ) ? 'fast' : 'slow' ;
403
422
navSwipeAttr ( disableAnimation ? '' : speed ) ;
404
423
backView . go ( ) ;
405
424
associatedNavBarCtrl && associatedNavBarCtrl . activeTransition && associatedNavBarCtrl . activeTransition . complete ( ! disableAnimation , speed ) ;
406
425
407
426
} else {
427
+ // cancel view transition on release
408
428
navSwipeAttr ( disableAnimation ? '' : 'fast' ) ;
409
429
disableRenderStartViewId = null ;
410
430
viewTransition . cancel ( ! disableAnimation ) ;
411
- associatedNavBarCtrl && associatedNavBarCtrl . activeTransition && associatedNavBarCtrl . activeTransition . cancel ( ! disableAnimation , 'fast' ) ;
431
+ associatedNavBarCtrl && associatedNavBarCtrl . activeTransition && associatedNavBarCtrl . activeTransition . cancel ( ! disableAnimation , 'fast' , cancelData ) ;
412
432
disableAnimation = null ;
413
433
}
414
434
0 commit comments