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

the banner doesn't show for nest view structure #6

Open
TonyLuo opened this issue Aug 24, 2015 · 4 comments
Open

the banner doesn't show for nest view structure #6

TonyLuo opened this issue Aug 24, 2015 · 4 comments

Comments

@TonyLuo
Copy link

TonyLuo commented Aug 24, 2015

when I try to use the banner in the view page which includes ion-nav-view, the banner doesn't show.

<ion-view view-title="booking">
  <ion-nav-title>
booking
  </ion-nav-title>
  <ion-nav-buttons side="primary">
    <button class="button button-clear" ng-click="showBanner()">
      Banner
    </button>
  </ion-nav-buttons>
  <ion-nav-buttons side="secondary">
    <button class="button button-icon icon ion-ios-search-strong" ng-click="showFilterBar()">
    </button>
  </ion-nav-buttons>

  <div class="bar bar-subheader">
    <ion-tabs class="tabs-striped tabs-color-assertive">
      <ion-tab title="processing" nav-clear ui-sref="main.booking.processing"></ion-tab>
      <ion-tab title="pending" nav-clear ui-sref="main.booking.pending"></ion-tab>
      <ion-tab title="all" nav-clear ui-sref="main.booking.all"></ion-tab>
    </ion-tabs>
  </div>

    <ion-nav-view name="bookingContent">
   </ion-nav-view>

</ion-view>
@hughred22
Copy link

I think I have the same issue. Do you see this error in your console?

TypeError: Cannot read property 'querySelector' of undefined
at Scope.angular.module.factory.scope.show (ionic.content.banner.js:149)

@mark-monserrat
Copy link

I have the same issue. I'm using ion-nav-view as well. What I did was I edited line 149: getActiveView(body).querySelector('.scroll-content').appendChild(element[0]);

into:

document.querySelector('.scroll-content').appendChild(element[0]);

and it worked. Maybe you can use this as well as temporary workaround

@johnnyoin
Copy link

I have a similar issue. I was able to resolve it with #28

@capoli
Copy link

capoli commented Dec 29, 2015

it has to do with the getActiveView function i just saw:
if you use for example tabs where 1 tab has multiple views you get following html/css structure:

screen shot 2015-12-29 at 16 18 36

if you use for example tabs where 1 tab hasn't multiple views, structure is as follow:

screen shot 2015-12-29 at 16 18 55

the getActiveView checks for a ion-view with an attribute nav-view="active"
i noticed that an ion-view component also gets a class "pane", so i changed the getActiveView function to check for an elemant that has 2 attributes: nav-view="active" and class="pane" to solve the problem:

function getActiveView (body) {
// get the candidate active views
var views = body.querySelectorAll('[nav-view="active"][class="pane"]');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants