toggle

fires on expanding/collapsing Sidebar

void toggle(boolean isCollapsed){ ... };

Deprecated

instead of it, you can use the following events:

sidebar.events.on("AfterCollapse", function() {
    // your logic here
});
sidebar.events.on("BeforeCollapse", function() {
    // your logic here
    return false;
});
sidebar.events.on("AfterExpand", function() {
    // your logic here
});
sidebar.events.on("BeforeExpand", function() {
    // your logic here
    return true;
});

Parameters

isCollapsedbooleantrue, if Sidebar is collapsed

Example

sidebar.events.on("Toggle",function(true){
   // your code here
});

Back to top