Preventing Panel widget from firing close events on page change
I've got some functions in the close event. This is getting fired every time I load a page via Ajax. If I have Ajax disabled, the close event is not fired.
The issue here is these functions fire when the close event fires; which in this particular case, is inside the pageshow event. Any thoughts here on how to prevent that?
Here's the code:
- $(document).delegate('[data-role="page"]', 'pageshow', function() {
- $('#side-panel').panel({
- beforeopen: function() {
- updateOpenClose($('.nav-toggle'));
- updateDeviceToggle();
- },
- close: function() {
- updateOpenClose($('.nav-toggle'));
- updateDeviceToggle();
- }
- });
- });