Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy all modals #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dennismonsewicz
Copy link

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
});

@trey
Copy link

trey commented Apr 28, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants