Browse Source

Added the ability to cancel a modal hide from the onHide callback

pull/3168/head
Michael de Hoog 9 years ago
parent
commit
b06b8779cc
1 changed files with 5 additions and 2 deletions
  1. 7
      src/definitions/modules/modal.js

7
src/definitions/modules/modal.js

@ -365,7 +365,10 @@ $.fn.modal = function(parameters) {
: function(){}
;
module.debug('Hiding modal');
settings.onHide.call(element);
if(settings.onHide.call(element, $(this)) === false) {
module.verbose('Hide callback returned false cancelling hide');
return;
}
if( module.is.animating() || module.is.active() ) {
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
@ -854,7 +857,7 @@ $.fn.modal.settings = {
onVisible : function(){},
// called before hide animation
onHide : function(){},
onHide : function(){ return true; },
// called after hide animation
onHidden : function(){},

Loading…
Cancel
Save