5

I have a set of links inside of a drawer. Just like the navigation example here:

http://www.getmdl.io/components/index.html#layout-section/layout

The only difference is that my links don't cause a page to refresh (it's a single page app built with backbone). How do I close the drawer after clicking a link?

Mike McKay
  • 2,388
  • 1
  • 29
  • 32

1 Answers1

2

Looks like there is a .is-visible class on the drawer, and by removing it, the drawer hides. So (using jquery) something like this toggles the drawer:

$(".mdl-layout__drawer").toggleClass("is-visible")

So I need to add that to an event handler for the links, or put it in an onClick attribute.

Mike McKay
  • 2,388
  • 1
  • 29
  • 32