mercredi 28 octobre 2020

Ember.js - extending a Bootstrap plugin's function

I am trying to extend the hide method of the Bootstrap modal plugin. I have many modals throughout the application and I would like to have a blanket solution to close the modal when a user hits the browser back button (instead of having to add the function to each modal instance in the application)

I know in Ember JS, you can override a component by importing it, calling the super method and adding your own customization. How can I do this with a Bootstrap modal plugin? I am not familiar with how to import the node_modules file in this scenario.

Essentially, what I want to do is this as a solution for all modals in the application:

 $(window).on('popstate', function() {
   $('.modal').modal('hide');
 });



Aucun commentaire:

Enregistrer un commentaire