paper-drawer-panel
paper-drawer-panel copied to clipboard
open-, close- and togglePanel should *always* work
Currently the open-, close- and togglePanel functions only work on mobile (eg narrow mode). I want to be able to open/close the drawer on desktop as well. In other words, I want to have my drawer behave the way that Google's Inbox drawer works as well.
The drawer should still default to closed on mobile (and the main page should still dim when the drawer is opened on mobile), but the decision to open/close/toggle based on the responsiveWidth currently is a bug IMHO
As a workaround you could do something like this in paper-drawer-panel
.
http://jsbin.com/lunixiholu/edit?html,output
Ah, I have a workaround using forceNarrow, but didn't hook up it up a media query (so my workaround doesn't work on mobile). Thanks for the suggestion!
I'm with liebrand about this. I need the close and open functions to work when im on a desktop layout and not respond only to the narrow mode. In my app i've got some sections to show my works(i'm an illustrator), and it's convenient to use all the screen possibles in this sections and close the drawer. Also i suggest that the drawerToggleAttribute need to be optional if you wanted to hide.
I would like close the drawer on desktop. :+1:
Nice solution have Google Plus, check out the https://plus.google.com
Take a look at my master branch, I made some modifications about toggle feature on desktop, tell me what you think. Demo is here. To summarize :
- drawerWidth attribute replaced with var --paper-drawer-panel-drawer-container-width
- remove the needs of _computeMainStyle() & _computeDrawerStyle()
- transitions are added on attached instead of on ready because #main default to left:0 and #main:not(.iron-selector) default to left:256px. As iron-selector class is added after ready (but before attached), left was translating from 256 to 0px on first render
- some style modifications for the drawer to toggle on desktop
- make the toggle button desapear when drawer is opened on desktop
I tried to embed paper-drawer-pane in existing GWT application - no matter what I tried toggle is not working. I tried every method etc.. No JavaScript errors generated - just not working. How funny... Most of other Polymer components are fine.