PolymerElements / paper-drawer-panel

A Material Design two-section responsive panel
https://www.webcomponents.org/element/PolymerElements/paper-drawer-panel
25 stars 42 forks source link

Force toggle drawer in pc mode #126

Closed morganwu closed 8 years ago

morganwu commented 8 years ago

I want the drawer can be closed by hand even in pc mode, just like the behavior of the side bar in user home page of new version Google Plus. I tried to force the drawer panel to be narrow, so I can toggle the drawer by calling togglePanel() when I clicked the menu icon, but the only issue is I want the drawer keep open before I click the menu button again, but the drawer will be closed anyway when I click on the backdrop(scrim). So is there any way to do that? Thanks.

WoodyWoodsta commented 8 years ago

By PC mode, do you mean when the screen is greater than the responsive width?

You might want to look into instead of using the toggleDrawer() method, write another method that adds and removes the force-narrow attribute on the press of the toggle button.

The solution is not the most elegant one, but it saves you hacking into the element.

morganwu commented 8 years ago

@WoodyWoodsta thank you for your answer and yes that is what I mean. I tried your answer, it works indeed.