mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix view hideNavBar attribute, closes #394
This commit is contained in:
12
dist/js/ionic-angular.js
vendored
12
dist/js/ionic-angular.js
vendored
@@ -2508,7 +2508,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
backButtonIcon: '@',
|
||||
alignTitle: '@'
|
||||
},
|
||||
template: '<header class="bar bar-header nav-bar">'+//' ng-class="{invisible: !navController.navBar.isVisible}">' +
|
||||
template: '<header class="bar bar-header nav-bar" ng-class="{invisible: !showNavBar}">' +
|
||||
'<div class="buttons"> ' +
|
||||
'<button view-back class="button" ng-if="enableBackButton" ng-class="backButtonClass" ng-bind-html="backButtonLabel"></button>' +
|
||||
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
|
||||
@@ -2518,7 +2518,7 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
'<button ng-click="button.tap($event)" ng-repeat="button in rightButtons" class="button no-animation {{button.type}}" ng-bind-html="button.content"></button>' +
|
||||
'</div>' +
|
||||
'</header>',
|
||||
link: function($scope, $element, $attr, navCtrl) {
|
||||
link: function($scope, $element, $attr) {
|
||||
|
||||
// Create the back button content and show/hide it based on scope settings
|
||||
$scope.enableBackButton = true;
|
||||
@@ -2527,8 +2527,10 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
$scope.backButtonClass += ' icon ' + $attr.backButtonIcon;
|
||||
}
|
||||
|
||||
// Store a reference to our nav controller
|
||||
$scope.navController = navCtrl;
|
||||
$scope.showNavBar = true;
|
||||
$rootScope.$on('viewState.showNavBar', function(e, data) {
|
||||
$scope.showNavBar = data;
|
||||
});
|
||||
|
||||
// Initialize our header bar view which will handle resizing and aligning our title labels
|
||||
var hb = new ionic.views.HeaderBar({
|
||||
@@ -2619,7 +2621,9 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
$rootScope.$broadcast('viewState.showBackButton', false);
|
||||
}
|
||||
|
||||
// Should the nav bar be hidden for this view or not?
|
||||
$scope.hideNavBar = $scope.$eval($scope.hideNavBar);
|
||||
$rootScope.$broadcast('viewState.showNavBar', !$scope.hideNavBar);
|
||||
|
||||
// watch for changes in the left buttons
|
||||
$scope.$watch('leftButtons', function(value) {
|
||||
|
||||
Reference in New Issue
Block a user