diff --git a/js/angular/controller/navViewController.js b/js/angular/controller/navViewController.js index 05bc2de5653..7832f4026ce 100644 --- a/js/angular/controller/navViewController.js +++ b/js/angular/controller/navViewController.js @@ -62,9 +62,7 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate, $scope.$on('$ionicTabs.leave', onTabsLeave); ionic.Platform.ready(function() { - if (ionic.Platform.isWebView() && $ionicConfig.views.swipeBackEnabled()) { - self.initSwipeBack(); - } + self.initSwipeBack(); }); return viewData; @@ -355,6 +353,10 @@ function($scope, $element, $attrs, $compile, $controller, $ionicNavBarDelegate, function onDragStart(ev) { if (!isPrimary) return; + if ( !$ionicConfig.views.swipeBackEnabled() || ! ionic.Platform.isIOS() ){ + return; + } + startDragX = getDragX(ev); if (startDragX > swipeBackHitWidth) return; diff --git a/js/angular/service/ionicConfig.js b/js/angular/service/ionicConfig.js index 08096208248..0e635a373f9 100644 --- a/js/angular/service/ionicConfig.js +++ b/js/angular/service/ionicConfig.js @@ -88,6 +88,16 @@ * @returns {boolean} */ + /** + * @ngdoc method + * @name $ionicConfigProvider#views.swipeBackEnabled + * @description By default on iOS devices, swipe to go back functionality is enabled by default. + * This method can be used to disable it globally, or on a per-view basis. + * Note: This functionality is only supported on iOS. + * @param {boolean} value + * @returns {boolean} + */ + /** * @ngdoc method * @name $ionicConfigProvider#scrolling.jsScrolling