I'm using the Drawer TagHelper and when the page opens, I'd like the Drawer to start open if the user cookie is set to open and closed if the cookie is set to closed. I am doing this currently using javascript but it causes it to open every time you go to a new page. Is there a setting on the taghelper that will cause it to start out open or closed rather than having to set it using javascript?
Thanks!
Laurie
Here's my code:
<
kendo-drawer
name
=
"drawer"
mode
=
"push"
on-hide
=
"onHide"
min
position
=
"left"
swipe-to-open
=
"false"
template-id
=
"template"
class
=
"no-border"
>
<
mini
enabled
=
"true"
/>
</
kendo-drawer
>
<
script
>
$(document).ready(function () {
var drawerInstance = $("#drawer").data().kendoDrawer;
var hideMenu = getCookie("HideCustomerMenu");
if (hideMenu == 'true') {
var arrowButton = $("#expand");
arrowButton.toggleClass('flip');
drawerInstance.hide();
}
else {
drawerInstance.show();
}
});
</
script
<script
id
=
"template"
type
=
"text/x-kendo-template"
>
<
ul
class
=
"menuBar list-unstyled"
>
<
li
id
=
"customerinfo"
><
a
href
=
"/customer"
><
i
class
=
"fa fa-user-circle fa-2x fa-fw mr-2"
aria-hidden
=
"true"
title
=
"Customer Information"
></
i
>Customer Info</
a
></
li
>
<
li
id
=
"test"
><
a
href
=
"/test"
><
i
class
=
"fa fa-user-circle fa-2x fa-fw mr-2"
aria-hidden
=
"true"
title
=
"Test"
></
i
>Test</
a
></
li
>
</
ul
>
</
script
>