Skip to content

Commit c375b6e

Browse files
author
Dan Bucholtz
committed
fix(navigation): swipe-to-go-back on a per-view basis in iOS issue #4574
1 parent 5d80cb1 commit c375b6e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Diff for: js/angular/controller/navViewController.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
6262
$scope.$on('$ionicTabs.leave', onTabsLeave);
6363

6464
ionic.Platform.ready(function() {
65-
if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) {
66-
self.initSwipeBack();
67-
}
65+
self.initSwipeBack();
6866
});
6967

7068
return viewData;
@@ -355,6 +353,10 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate,
355353
function onDragStart(ev) {
356354
if (!isPrimary) return;
357355

356+
if ( !$ionicConfig.views.swipeBackEnabled() || ! ionic.Platform.isIOS() ){
357+
return;
358+
}
359+
358360
startDragX = getDragX(ev);
359361
if (startDragX > swipeBackHitWidth) return;
360362

Diff for: js/angular/service/ionicConfig.js

+10
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@
8888
* @returns {boolean}
8989
*/
9090

91+
/**
92+
* @ngdoc method
93+
* @name $ionicConfigProvider#views.swipeBackEnabled
94+
* @description By default on iOS devices, swipe to go back functionality is enabled by default.
95+
* This method can be used to disable it globally, or on a per-view basis.
96+
* Note: This functionality is only supported on iOS.
97+
* @param {boolean} value
98+
* @returns {boolean}
99+
*/
100+
91101
/**
92102
* @ngdoc method
93103
* @name $ionicConfigProvider#scrolling.jsScrolling

0 commit comments

Comments
 (0)