Reworked destroy method to be a little more global, so it can be called by itself from the smoke object. The use case was if using the smoke library with the routing system inside of Backbone. If a user navigates to a route, then proceeds to click the back button in the browser and a smoke modal is open, the modal doesn't close.
Here is how you can get around the issue with Backbone.Router and the changes in this PR:
Backbone.Router.extend({
execute: function(callback, args) {
// make sure smoke object is present
if(smoke.newid) {
smoke.destroy();
}
if (callback) callback.apply(this, args);
},
// other codez
});
Reworked
destroy
method to be a little more global, so it can be called by itself from the smoke object. The use case was if using thesmoke
library with the routing system inside of Backbone. If a user navigates to a route, then proceeds to click the back button in the browser and a smoke modal is open, the modal doesn't close.Here is how you can get around the issue with
Backbone.Router
and the changes in this PR: