mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
Fixed #40 with test
This commit is contained in:
11
dist/js/ionic-angular.js
vendored
11
dist/js/ionic-angular.js
vendored
@ -858,6 +858,14 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
|
||||
angular.extend(this, ionic.controllers.TabBarController.prototype);
|
||||
|
||||
ionic.controllers.TabBarController.call(this, {
|
||||
controllerChanged: function(oldC, oldI, newC, newI) {
|
||||
$scope.controllerChanged && $scope.controllerChanged({
|
||||
oldController: oldC,
|
||||
oldIndex: oldI,
|
||||
newController: newC,
|
||||
newIndex: newI
|
||||
});
|
||||
},
|
||||
tabBar: {
|
||||
tryTabSelect: function() {},
|
||||
setSelectedItem: function(index) {},
|
||||
@ -891,7 +899,8 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
scope: {
|
||||
animation: '@'
|
||||
animation: '@',
|
||||
controllerChanged: '&'
|
||||
},
|
||||
transclude: true,
|
||||
controller: 'TabsCtrl',
|
||||
|
||||
6
dist/js/ionic.js
vendored
6
dist/js/ionic.js
vendored
@ -4923,7 +4923,6 @@ ionic.controllers.TabBarController = ionic.controllers.ViewController.inherit({
|
||||
|
||||
if(shouldChange) {
|
||||
this.setSelectedController(index);
|
||||
this.controllerChanged && this.controllerChanged(this.selectedController, this.selectedIndex);
|
||||
}
|
||||
},
|
||||
|
||||
@ -4932,11 +4931,16 @@ ionic.controllers.TabBarController = ionic.controllers.ViewController.inherit({
|
||||
if(index >= this.controllers.length) {
|
||||
return;
|
||||
}
|
||||
var lastController = this.selectedController;
|
||||
var lastIndex = this.selectedIndex;
|
||||
|
||||
this.selectedController = this.controllers[index];
|
||||
this.selectedIndex = index;
|
||||
|
||||
this._showController(index);
|
||||
this.tabBar.setSelectedItem(index);
|
||||
|
||||
this.controllerChanged && this.controllerChanged(lastController, lastIndex, this.selectedController, this.selectedIndex);
|
||||
},
|
||||
|
||||
_showController: function(index) {
|
||||
|
||||
Reference in New Issue
Block a user