exit method won't unbind css method.
My website is responsible website, so if the screen became wider, i should call 'exit' method as described on Slidebars document.
After I called 'exit' method slidebars throws strange error. slidebars.js:173 Uncaught Slidebars hasn't been initialized.
I investigated code, and I found the 'css' method is bound to window resize event.
I think 'exit' method should unbind 'css' method. And also when binding 'css' method to window rezise event, namespace should be uses with it. I tried to unbind 'css' method with manual way, it is really hard to unbind specific method without namespace via jQuery.
Hi,
I have a similar issue with "Uncaught Slidebars hasn't been initialized" When I resize the browser. How did you fix this in the end?
@wonsuc @hartey11
Keep in mind that if you trigger exit without having initialized Slidebars it will throw this error.
Might be a good idea to check isActive() first.
if ( slidebarsInstance.isActive() ) {
slidebarsInstance.exit();
}
And also for initializing:
if ( ! slidebarsInstance.isActive() ) {
slidebarsInstance.init();
}