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

Making the left paperDrawerPanel reacting to responsive width #104

Open
addyosmani opened this issue Oct 21, 2015 · 1 comment
Open

Making the left paperDrawerPanel reacting to responsive width #104

addyosmani opened this issue Oct 21, 2015 · 1 comment

Comments

@addyosmani
Copy link
Contributor

From @gedw99 on October 12, 2015 11:7

We are trying to make the drawer respond a bit differently from what it does in the demo

We have the same menu buttons in the top menu & the left drawer panel.
We want this behaviour.
  when desktop mode (responsiveWidth > 300px):
    - hide hamburger, and hence the left drawerPanel
    - show the top menu
  when mobile mode (responsiveWidth < 300px):
    - show hamburger, and hence on press the left drawerPanel
    - hide the top menu

at the moment the only event i can tap into is:
addEventListener('paper-responsive-change', function(e)
This is after the event, but i really need to get access to the before event

I am wondering if someone can recommend an approach.

Copied from original issue: Polymer/polymer-starter-kit#432

@mbecker
Copy link

mbecker commented Feb 20, 2016

Hi,

please try the following:

  • Add id="drawer" to your drawer
<paper-drawer-panel id="paperDrawerPanel" right-drawer responsive-width="668px">
      <!-- Drawer Scroll Header Panel -->
      <paper-scroll-header-panel drawer fixed id="drawer">
  • Add the following meadia query to main.css
@media (min-width: 668px) {
   #main.paper-drawer-panel {
        right: 0px!important;
    }
    #drawer {
        display: none;
    }
}

(Please notice that I'm using here "right-drawer; changing "right: 0px!important" to "left: 0px!important" should do the trick).

Does it work?

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

No branches or pull requests

3 participants