Removed named controller for tabs

This commit is contained in:
Max Lynch
2013-11-29 16:02:15 -06:00
parent 0cc6c1b795
commit b44035bfe3
4 changed files with 72 additions and 77 deletions

4
dist/css/ionic.css vendored
View File

@@ -1,3 +1,4 @@
@charset "UTF-8";
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/
@@ -3222,9 +3223,6 @@ a.subdued {
right: 0; }
.menu-animated {
-webkit-transition: transform 200ms ease;
-moz-transition: transform 200ms ease;
transition: transform 200ms ease;
-webkit-transition: -webkit-transform 200ms ease;
-moz-transition: -moz-transform 200ms ease;
transition: transform 200ms ease; }

View File

@@ -1,3 +1,4 @@
@charset "UTF-8";
/*!
* Copyright 2013 Drifty Co.
* http://drifty.com/

View File

@@ -2066,49 +2066,47 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
* on a tab bar. Modelled off of UITabBarController.
*/
.controller('TabsCtrl', ['$scope', '$element', '$animate', function($scope, $element, $animate) {
var _this = this;
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) {},
addItem: function(item) {}
}
});
this.add = function(controller) {
this.addController(controller);
this.select(0);
};
this.select = function(controllerIndex) {
$scope.activeAnimation = $scope.animation;
_this.selectController(controllerIndex);
};
$scope.controllers = this.controllers;
$scope.tabsController = this;
}])
.directive('tabs', function() {
return {
restrict: 'E',
replace: true,
scope: true,
transclude: true,
controller: 'TabsCtrl',
controller: ['$scope', '$element', '$animate', function($scope, $element, $animate) {
var _this = this;
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) {},
addItem: function(item) {}
}
});
this.add = function(controller) {
this.addController(controller);
this.select(0);
};
this.select = function(controllerIndex) {
$scope.activeAnimation = $scope.animation;
_this.selectController(controllerIndex);
};
$scope.controllers = this.controllers;
$scope.tabsController = this;
}],
//templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html',
template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>',
compile: function(element, attr, transclude, tabsCtrl) {

View File

@@ -7,49 +7,47 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
* on a tab bar. Modelled off of UITabBarController.
*/
.controller('TabsCtrl', ['$scope', '$element', '$animate', function($scope, $element, $animate) {
var _this = this;
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) {},
addItem: function(item) {}
}
});
this.add = function(controller) {
this.addController(controller);
this.select(0);
};
this.select = function(controllerIndex) {
$scope.activeAnimation = $scope.animation;
_this.selectController(controllerIndex);
};
$scope.controllers = this.controllers;
$scope.tabsController = this;
}])
.directive('tabs', function() {
return {
restrict: 'E',
replace: true,
scope: true,
transclude: true,
controller: 'TabsCtrl',
controller: ['$scope', '$element', '$animate', function($scope, $element, $animate) {
var _this = this;
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) {},
addItem: function(item) {}
}
});
this.add = function(controller) {
this.addController(controller);
this.select(0);
};
this.select = function(controllerIndex) {
$scope.activeAnimation = $scope.animation;
_this.selectController(controllerIndex);
};
$scope.controllers = this.controllers;
$scope.tabsController = this;
}],
//templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html',
template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>',
compile: function(element, attr, transclude, tabsCtrl) {