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

Toggle toolbars based on view, problem with transition animation #8

Open
weoreference opened this issue Sep 22, 2017 · 0 comments
Open

Comments

@weoreference
Copy link

weoreference commented Sep 22, 2017

Hello : )

(Referring to the demo app):

Suppose in app.js, my views objects also define what toolbar each view will use:

 this.views = [{
            name: 'index',
            navTitle: 'Home',
            moduleId: './pages/index/index',
            nav: true,
            homepage: true,
            toolbar: 'main-toolbar',
        }, 
            name: 'second-page',
            navTitle: 'Second Page',
            moduleId: './pages/other-page/other',
            nav: true,
            toolbar: 'main-toolbar',
        }, {
            name: 'other-page',
            navTitle: 'Other Page',
            moduleId: './pages/other-page/other',
            nav: true,
            toolbar: 'other-toolbar',
        }]

Note that:

  • Home and Second Page are both using the main-toolbar
  • Other Page, however, is using the other-toolbar

My wish is achieving the following outcome:

  • When I navigate from Home to Second Page, the toolbar will not change, nor will it be subject to any of the page transition effects between these two pages. (In other words, the toolbar will behave as if "globally").
  • When I navigate from Home to Other Page (or from Second Page to Other Page), the toolbar should, of course, change, and it should, presumably, be subject to the page transition effects.

However, I have not been able to achieve this outcome...

My problem in app.html is as follows:

  • If I define the <div class="toolbar" within <div repeat.for="view of views", then the toolbar will always transition in-and-out on every page change, regardless if both pages had shared the same toolbar. (In other words, the toolbar will never behave "globally").
  • If I define the <div class="toolbar" outside of <div repeat.for="view of views", then the toolbar will always behave "globally" (i.e. it will remain fixed regardless of page transitions). However, I lose scope of the view iterant, and therefore am no longer able to adapt the toolbar based on the view's toolbar property.

What would be a common pattern for addressing this category of problem?

Thank you
-Andy

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

1 participant