powmedia / backbone.bootstrap-modal

Bootstrap Modal wrapper for use with Backbone.
MIT License
183 stars 97 forks source link

Closing topmost stacked modal causes body to lose "modal-open" class #77

Open Braza opened 9 years ago

Braza commented 9 years ago

This might be a trouble if the intermediate modal is high enough so that it needs scrolling. Body will scroll in this case.

Braza commented 9 years ago

suggesting fix that worked for me:

       $el.modal('hide');

       Modal.count--;
+      if (Modal.count >0){
+        $(document.body).addClass( "modal-open" );
+      }
+
     },

     /**
      * Stop the modal from closing.
      * Can be called from within a 'close' or 'ok' event listener.