mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Normalized button API for headers and nav bars
This commit is contained in:
8
dist/js/ionic-angular.js
vendored
8
dist/js/ionic-angular.js
vendored
@@ -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>',
|
||||
@@ -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) {
|
||||
|
||||
4
js/ext/angular/src/directive/ionicBar.js
vendored
4
js/ext/angular/src/directive/ionicBar.js
vendored
@@ -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>',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
$scope.leftButtons = [
|
||||
{
|
||||
content: 'Hello',
|
||||
click: function(e) {
|
||||
tap: function(e) {
|
||||
console.log('Click button');
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
$scope.rightButtons = [
|
||||
{
|
||||
content: 'Hello',
|
||||
click: function(e) {
|
||||
tap: function(e) {
|
||||
console.log('Click button');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
.controller('AdoptCtrl', function($scope) {
|
||||
$scope.buttons = [
|
||||
{
|
||||
text: 'Adopt',
|
||||
content: 'Adopt',
|
||||
tap: function(e) {
|
||||
console.log('ADOPT TAPPED');
|
||||
},
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
|
||||
$scope.rightButtons = [
|
||||
{
|
||||
text: 'Hello',
|
||||
click: function(e) {
|
||||
content: 'Hello',
|
||||
tap: function(e) {
|
||||
console.log('Click button');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user