Button click support

This commit is contained in:
Max Lynch
2013-11-19 15:51:04 -06:00
parent 2064126e5f
commit 4586516e0e
4 changed files with 24 additions and 12 deletions

View File

@ -25430,11 +25430,11 @@ angular.module('ionic.ui.navRouter', [])
template: '<header class="bar bar-header nav-bar" ng-class="{hidden: !navController.navBar.isVisible}">' +
'<div class="buttons"> ' +
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonType" ng-bind-html="backButtonContent"></button>' +
'<button ng-repeat="button in leftButtons" class="button" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<div class="buttons"> ' +
'<button ng-repeat="button in rightButtons" class="button" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'</div>' +
'</header>',
link: function($scope, $element, $attr, navCtrl) {
@ -25478,7 +25478,10 @@ angular.module('ionic.ui.navRouter', [])
var oldTitle = $scope.currentTitle;
$scope.oldTitle = oldTitle;
$scope.currentTitle = data.title;
if(typeof data.title !== 'undefined') {
$scope.currentTitle = data.title;
}
if(typeof data.leftButtons !== 'undefined') {
$scope.leftButtons = data.leftButtons;
@ -25490,7 +25493,7 @@ angular.module('ionic.ui.navRouter', [])
$scope.enableBackButton = data.hideBackButton !== true;
}
if(data.animate !== false) {
if(data.animate !== false && typeof data.title !== 'undefined') {
animate($scope, $element, oldTitle, data, function() {
hb.align();
});
@ -26041,7 +26044,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
rightButtons: $scope.rightButtons,
leftButtons: $scope.leftButtons,
hideBackButton: $scope.hideBackButton || false,
animate: $scope.animate || false
animate: $scope.animate || true
});
}
//$scope.$emit('navRouter.titleChanged', $scope.title);

View File

@ -167,11 +167,11 @@ angular.module('ionic.ui.navRouter', [])
template: '<header class="bar bar-header nav-bar" ng-class="{hidden: !navController.navBar.isVisible}">' +
'<div class="buttons"> ' +
'<button nav-back class="button" ng-if="enableBackButton && showBackButton" ng-class="backButtonType" ng-bind-html="backButtonContent"></button>' +
'<button ng-repeat="button in leftButtons" class="button" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'</div>' +
'<h1 class="title" ng-bind="currentTitle"></h1>' +
'<div class="buttons"> ' +
'<button ng-repeat="button in rightButtons" class="button" ng-bind="button.text"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button {{button.type}}" ng-bind="button.text"></button>' +
'</div>' +
'</header>',
link: function($scope, $element, $attr, navCtrl) {
@ -215,7 +215,10 @@ angular.module('ionic.ui.navRouter', [])
var oldTitle = $scope.currentTitle;
$scope.oldTitle = oldTitle;
$scope.currentTitle = data.title;
if(typeof data.title !== 'undefined') {
$scope.currentTitle = data.title;
}
if(typeof data.leftButtons !== 'undefined') {
$scope.leftButtons = data.leftButtons;
@ -227,7 +230,7 @@ angular.module('ionic.ui.navRouter', [])
$scope.enableBackButton = data.hideBackButton !== true;
}
if(data.animate !== false) {
if(data.animate !== false && typeof data.title !== 'undefined') {
animate($scope, $element, oldTitle, data, function() {
hb.align();
});

View File

@ -138,7 +138,7 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
rightButtons: $scope.rightButtons,
leftButtons: $scope.leftButtons,
hideBackButton: $scope.hideBackButton || false,
animate: $scope.animate || false
animate: $scope.animate || true
});
}
//$scope.$emit('navRouter.titleChanged', $scope.title);

View File

@ -17,7 +17,7 @@
</pane>
<script id="page1.html" type="text/ng-template">
<nav-page title="'Pets'" hide-back-button="true">
<nav-page hide-back-button="true">
<tabs tabs-style="tabs-icon-top" tabs-type="tabs-positive">
<!-- Pets tab -->
@ -133,7 +133,13 @@
.controller('AdoptCtrl', function($scope) {
$scope.buttons = [
{ text: 'Adopt' }
{
text: 'Adopt',
tap: function(e) {
console.log('ADOPT TAPPED');
},
type: 'button-clear'
}
];
});