Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hideNavBar attribute of ionView directive doesn't remove has-header class from contained ionContent directive #927

Closed
ciastek opened this issue Mar 27, 2014 · 5 comments

Comments

@ciastek
Copy link

ciastek commented Mar 27, 2014

Using hideNavBar attribute you can hide navBar on selected ionView as described on ionView documentation page.

Using Ionic v0.9.27 it was possible to not add hasHeader attribute to ionContent to make view look decent with navBar hidden (see example).

It's not possible with Ionic v1.0.0-beta.1 as it has removed hasHeader attribute from ionContent directive. Instead it adds has-header class to the ion-content element automatically (see example).

hideNavBar attribute of ionView directive should conform with new behaviour and remove has-header class from ion-content element.

NOTE: As a workaround you can set $scope.$hasHeader=false on view's controller to prevent adding has-header class to the ion-content element.

@ajoslin
Copy link
Contributor

ajoslin commented Mar 27, 2014

Fixed in nightly! Thanks @ciastek .

This codepen should work within 20 minutes, when the build is pushed out: http://codepen.io/ionic/pen/bfc811ca6e8ce0ce1e2fe79b7601059a/

@lambrospetrou
Copy link

If I have the ion-nav-bar hidden but I have another HTML code acting as header with the class 'bar-header' then the ion-content class 'has-header' is being removed on SECOND load of the view whreas it works fine the first time.
It seems that ionic removes the has-header class when it loads the view from cache because it sees that the ion-nav-bar is hidden, but it ignores the fact that I have another element with the bar-header class.

@yonirab
Copy link

yonirab commented Nov 8, 2015

@lambrospetrou did you find a solution for this problem? I am seeing the exact same issue...

@ievhenganchin
Copy link

@lambrospetrou , @yonirab

if this is still actual:

$timeout(function() {
       angular.element(document.getElementById("content")).removeClass("has-header");
 });

@mjandrevska
Copy link

I have the same issue as @lambrospetrou. Fixed it like @ciastek and it's working.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants