Skip to content

Commit 78a8adc

Browse files
committed
Normalized button API for headers and nav bars
1 parent a83b573 commit 78a8adc

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

dist/js/ionic-angular.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,12 @@ angular.module('ionic.ui.header', ['ngAnimate'])
503503
transclude: true,
504504
template: '<header class="bar bar-header">\
505505
<div class="buttons">\
506-
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
506+
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
507507
</button>\
508508
</div>\
509509
<h1 class="title" ng-bind-html="title"></h1>\
510510
<div class="buttons">\
511-
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
511+
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
512512
</button>\
513513
</div>\
514514
</header>',
@@ -1219,11 +1219,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
12191219
template: '<header class="bar bar-header nav-bar" ng-class="{invisible: !navController.navBar.isVisible}">' +
12201220
'<div class="buttons"> ' +
12211221
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
1222-
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
1222+
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
12231223
'</div>' +
12241224
'<h1 class="title" ng-bind="currentTitle"></h1>' +
12251225
'<div class="buttons" ng-if="rightButtons.length"> ' +
1226-
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
1226+
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
12271227
'</div>' +
12281228
'</header>',
12291229
link: function($scope, $element, $attr, navCtrl) {

js/ext/angular/src/directive/ionicBar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ angular.module('ionic.ui.header', ['ngAnimate'])
1111
transclude: true,
1212
template: '<header class="bar bar-header">\
1313
<div class="buttons">\
14-
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
14+
<button ng-repeat="button in leftButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
1515
</button>\
1616
</div>\
1717
<h1 class="title" ng-bind-html="title"></h1>\
1818
<div class="buttons">\
19-
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.click($event, $index)" ng-bind-html="button.content">\
19+
<button ng-repeat="button in rightButtons" class="button" ng-class="button.type" ng-click="button.tap($event, $index)" ng-bind-html="button.content">\
2020
</button>\
2121
</div>\
2222
</header>',

js/ext/angular/src/directive/ionicNavRouter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
191191
template: '<header class="bar bar-header nav-bar" ng-class="{invisible: !navController.navBar.isVisible}">' +
192192
'<div class="buttons"> ' +
193193
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
194-
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
194+
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
195195
'</div>' +
196196
'<h1 class="title" ng-bind="currentTitle"></h1>' +
197197
'<div class="buttons" ng-if="rightButtons.length"> ' +
198-
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
198+
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind-html="button.content"></button>' +
199199
'</div>' +
200200
'</header>',
201201
link: function($scope, $element, $attr, navCtrl) {

js/ext/angular/test/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
$scope.leftButtons = [
3333
{
3434
content: 'Hello',
35-
click: function(e) {
35+
tap: function(e) {
3636
console.log('Click button');
3737
}
3838
}
3939
]
4040
$scope.rightButtons = [
4141
{
4242
content: 'Hello',
43-
click: function(e) {
43+
tap: function(e) {
4444
console.log('Click button');
4545
}
4646
}

js/ext/angular/test/navAndTabs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h1>Page 3</h1>
139139
.controller('AdoptCtrl', function($scope) {
140140
$scope.buttons = [
141141
{
142-
text: 'Adopt',
142+
content: 'Adopt',
143143
tap: function(e) {
144144
console.log('ADOPT TAPPED');
145145
},

js/ext/angular/test/navRouter.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ <h1>Page 3</h1>
7979

8080
$scope.rightButtons = [
8181
{
82-
text: 'Hello',
83-
click: function(e) {
82+
content: 'Hello',
83+
tap: function(e) {
8484
console.log('Click button');
8585
}
8686
}

0 commit comments

Comments
 (0)