drawer component improvement suggestion
Hey, Metronic 8
When using the drawer component and use the same element for submenu on desktop and drawer on mobile, what is needed is to turn :
data-kt-drawer-activate="{default: true, lg: false}"
data-kt-drawer-overlay="{default: true, lg: false}" you have some efficiency issue, the drawer logic is still working behind the scene also when its not activated, you can see it on "body" that the drawer is turned "on" when clicking the element.
my suggestion is to add logic of checking if the activate option is enabled on "toggle" method of drawer:
var _toggle = function() {
if ( KTEventHandler.trigger(the.element, "kt.drawer.toggle", the) === false || _getOption("activate") === false) {
return;
}
if ( the.shown === true ) {
_hide();
} else {
_show();
}
KTEventHandler.trigger(the.element, "kt.drawer.toggled", the);
} Replies (3)
Deleted comment
Hi,
Thank you for your suggestion. We will check this further and consider adding your improvement in the next update of Metronic v8.
May I know which Metronic version you have tried this with?
Regards,
Sean