mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
Don't throttle push or pop function, only the UI interaction
This commit is contained in:
34
dist/js/ionic-angular.js
vendored
34
dist/js/ionic-angular.js
vendored
@ -23925,7 +23925,7 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
* Push a template onto the navigation stack.
|
* Push a template onto the navigation stack.
|
||||||
* @param {string} templateUrl the URL of the template to load.
|
* @param {string} templateUrl the URL of the template to load.
|
||||||
*/
|
*/
|
||||||
this.pushFromTemplate = ionic.throttle(function(templateUrl) {
|
this.pushFromTemplate = function(templateUrl) {
|
||||||
var childScope = $scope.$new();
|
var childScope = $scope.$new();
|
||||||
var last = _this.getTopController();
|
var last = _this.getTopController();
|
||||||
|
|
||||||
@ -23960,12 +23960,10 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 300, {
|
};
|
||||||
trailing: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// Pop function, throttled
|
// Pop function
|
||||||
this.popController = ionic.throttle(function() {
|
this.popController = function() {
|
||||||
var last = _this.pop();
|
var last = _this.pop();
|
||||||
|
|
||||||
var next = _this.getTopController();
|
var next = _this.getTopController();
|
||||||
@ -23987,9 +23985,7 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.$parent.$broadcast('navigation.pop');
|
$scope.$parent.$broadcast('navigation.pop');
|
||||||
}, 300, {
|
};
|
||||||
trailing: false
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Extend the low-level navigation controller
|
// Extend the low-level navigation controller
|
||||||
@ -24181,18 +24177,24 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
}])
|
}])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the nav controller in the current scope to push a new
|
||||||
|
* controller onto the stack, with the given template URL.
|
||||||
|
*/
|
||||||
.directive('navPush', function() {
|
.directive('navPush', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attr) {
|
link: function($scope, $element, $attr) {
|
||||||
var templateUrl = $attr.navPush;
|
var templateUrl = $attr.navPush;
|
||||||
|
|
||||||
var pushTemplate = function(e) {
|
var pushTemplate = ionic.throttle(function(e) {
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.navController && $scope.navController.pushFromTemplate(templateUrl);
|
$scope.navController && $scope.navController.pushFromTemplate(templateUrl);
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
};
|
}, 300, {
|
||||||
|
trailing: false
|
||||||
|
});
|
||||||
|
|
||||||
$element.bind('tap', pushTemplate);
|
$element.bind('tap', pushTemplate);
|
||||||
|
|
||||||
@ -24203,16 +24205,22 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the nav controller in the current scope to pop the top controller
|
||||||
|
* and go back in the stack.
|
||||||
|
*/
|
||||||
.directive('navPop', function() {
|
.directive('navPop', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attr, navCtrl) {
|
link: function($scope, $element, $attr, navCtrl) {
|
||||||
var popTemplate = function(e) {
|
var popTemplate = ionic.throttle(function(e) {
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.navController && navController.pop();
|
$scope.navController && navController.pop();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
};
|
}, 300, {
|
||||||
|
trailing: false
|
||||||
|
});
|
||||||
|
|
||||||
$element.bind('tap', popTemplate);
|
$element.bind('tap', popTemplate);
|
||||||
|
|
||||||
|
|||||||
34
js/ext/angular/src/directive/ionicNav.js
vendored
34
js/ext/angular/src/directive/ionicNav.js
vendored
@ -40,7 +40,7 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
* Push a template onto the navigation stack.
|
* Push a template onto the navigation stack.
|
||||||
* @param {string} templateUrl the URL of the template to load.
|
* @param {string} templateUrl the URL of the template to load.
|
||||||
*/
|
*/
|
||||||
this.pushFromTemplate = ionic.throttle(function(templateUrl) {
|
this.pushFromTemplate = function(templateUrl) {
|
||||||
var childScope = $scope.$new();
|
var childScope = $scope.$new();
|
||||||
var last = _this.getTopController();
|
var last = _this.getTopController();
|
||||||
|
|
||||||
@ -75,12 +75,10 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 300, {
|
};
|
||||||
trailing: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// Pop function, throttled
|
// Pop function
|
||||||
this.popController = ionic.throttle(function() {
|
this.popController = function() {
|
||||||
var last = _this.pop();
|
var last = _this.pop();
|
||||||
|
|
||||||
var next = _this.getTopController();
|
var next = _this.getTopController();
|
||||||
@ -102,9 +100,7 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.$parent.$broadcast('navigation.pop');
|
$scope.$parent.$broadcast('navigation.pop');
|
||||||
}, 300, {
|
};
|
||||||
trailing: false
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Extend the low-level navigation controller
|
// Extend the low-level navigation controller
|
||||||
@ -296,18 +292,24 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
}])
|
}])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the nav controller in the current scope to push a new
|
||||||
|
* controller onto the stack, with the given template URL.
|
||||||
|
*/
|
||||||
.directive('navPush', function() {
|
.directive('navPush', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attr) {
|
link: function($scope, $element, $attr) {
|
||||||
var templateUrl = $attr.navPush;
|
var templateUrl = $attr.navPush;
|
||||||
|
|
||||||
var pushTemplate = function(e) {
|
var pushTemplate = ionic.throttle(function(e) {
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.navController && $scope.navController.pushFromTemplate(templateUrl);
|
$scope.navController && $scope.navController.pushFromTemplate(templateUrl);
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
};
|
}, 300, {
|
||||||
|
trailing: false
|
||||||
|
});
|
||||||
|
|
||||||
$element.bind('tap', pushTemplate);
|
$element.bind('tap', pushTemplate);
|
||||||
|
|
||||||
@ -318,16 +320,22 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell the nav controller in the current scope to pop the top controller
|
||||||
|
* and go back in the stack.
|
||||||
|
*/
|
||||||
.directive('navPop', function() {
|
.directive('navPop', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
link: function($scope, $element, $attr, navCtrl) {
|
link: function($scope, $element, $attr, navCtrl) {
|
||||||
var popTemplate = function(e) {
|
var popTemplate = ionic.throttle(function(e) {
|
||||||
$scope.$apply(function() {
|
$scope.$apply(function() {
|
||||||
$scope.navController && navController.pop();
|
$scope.navController && navController.pop();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
};
|
}, 300, {
|
||||||
|
trailing: false
|
||||||
|
});
|
||||||
|
|
||||||
$element.bind('tap', popTemplate);
|
$element.bind('tap', popTemplate);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user