Making sure Drawer ALWAYS closes after click

2 posts, 0 answers
  1. Mark
    Mark avatar
    25 posts
    Member since:
    Dec 2013

    Posted 30 Dec 2013 Link to this post

    I am trying to make sure that my drawer always closes after a click.  Right now I have my drawer items set with data-link's to change to different views.  My issue is say I am on a view called "Preview" and I open the drawer and click the button for "Preview".  Since it is already on the "Preview" page the drawer stays open, which could lead some users to not be sure if it is responding (they may not realize they are already looking at the view they want to navigate too).

    I've tried added onclick events to call the drawer.hide() method, which screws up all navigation.  If I am on a "Preview" view and want to go to "Contacts" view, the hide method on click screws the views up and cannot open the drawer again unless I refresh the page.

    Is there any way to ensure hide is always called when the drawer is clicked? (even if the view doesn't change).

  2. Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 02 Jan 2014 Link to this post

    Hi Mark,

    You can find a way to compare the current view item and the item link clicked from the Drawer, and if they are one and the same (the use tries to navigate to the same view) you can use the hide() method to hide the drawer. I have managed to do something similar in this example:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top