Skip to content

Commit

Permalink
Normalized button API for headers and nav bars
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Dec 4, 2013
1 parent a83b573 commit 78a8adc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions dist/js/ionic-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,12 @@ angular.module('ionic.ui.header', ['ngAnimate'])
transclude: true,
template: '<header class="bar bar-header">\
<div class="buttons">\
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
</button>\
</div>\
<h1 class="title" ng-bind-html="title"></h1>\
<div class="buttons">\
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
</button>\
</div>\
</header>',
Expand Down Expand Up @@ -1219,11 +1219,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
template: '<header class="bar bar-header nav-bar" ng-class="{invisible: !navController.navBar.isVisible}">' +
'<div class="buttons"> ' +
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<div class="buttons" ng-if="rightButtons.length"> ' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'</header>',
link: function($scope, $element, $attr, navCtrl) {
Expand Down
4 changes: 2 additions & 2 deletions js/ext/angular/src/directive/ionicBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ angular.module('ionic.ui.header', ['ngAnimate'])
transclude: true,
template: '<header class="bar bar-header">\
<div class="buttons">\
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
</button>\
</div>\
<h1 class="title" ng-bind-html="title"></h1>\
<div class="buttons">\
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
</button>\
</div>\
</header>',
Expand Down
4 changes: 2 additions & 2 deletions js/ext/angular/src/directive/ionicNavRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
template: '<header class="bar bar-header nav-bar" ng-class="{invisible: !navController.navBar.isVisible}">' +
'<div class="buttons"> ' +
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<div class="buttons" ng-if="rightButtons.length"> ' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
'</div>' +
'</header>',
link: function($scope, $element, $attr, navCtrl) {
Expand Down
4 changes: 2 additions & 2 deletions js/ext/angular/test/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
$scope.leftButtons = [
{
content: 'Hello',
click: function(e) {
tap: function(e) {
console.log('Click button');
}
}
]
$scope.rightButtons = [
{
content: 'Hello',
click: function(e) {
tap: function(e) {
console.log('Click button');
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/ext/angular/test/navAndTabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ <h1>Page 3</h1>
.controller('AdoptCtrl', function($scope) {
$scope.buttons = [
{
text: 'Adopt',
content: 'Adopt',
tap: function(e) {
console.log('ADOPT TAPPED');
},
Expand Down
4 changes: 2 additions & 2 deletions js/ext/angular/test/navRouter.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ <h1>Page 3</h1>

$scope.rightButtons = [
{
text: 'Hello',
click: function(e) {
content: 'Hello',
tap: function(e) {
console.log('Click button');
}
}
Expand Down

0 comments on commit 78a8adc

Please sign in to comment.