This is a migrated thread and some comments may be shown as answers.

Making sure Drawer ALWAYS closes after click

1 Answer 248 Views
Drawer (Mobile)
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 30 Dec 2013, 09:24 PM
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).

Thanks

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 02 Jan 2014, 07:51 AM
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:

http://jsbin.com/INovuHeX/1/edit

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Drawer (Mobile)
Asked by
Mark
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or