Browse Source

Fixes #1367, scrolling is not removed if modals already visible

pull/1407/head
jlukic 10 years ago
parent
commit
b269305a10
1 changed files with 14 additions and 9 deletions
  1. 23
      src/definitions/modules/modal.js

23
src/definitions/modules/modal.js

@ -220,11 +220,13 @@ $.fn.modal = function(parameters) {
if( $(event.target).closest(selector.modal).size() === 0 ) { if( $(event.target).closest(selector.modal).size() === 0 ) {
module.debug('Dimmer clicked, hiding all modals'); module.debug('Dimmer clicked, hiding all modals');
module.remove.clickaway(); module.remove.clickaway();
if(settings.allowMultiple) {
module.hide();
}
else {
module.hideAll();
if( module.is.active() ) {
if(settings.allowMultiple) {
module.hide();
}
else {
module.hideAll();
}
} }
} }
}, },
@ -360,6 +362,7 @@ $.fn.modal = function(parameters) {
module.debug('Hiding dimmer'); module.debug('Hiding dimmer');
$dimmable.dimmer('hide', function() { $dimmable.dimmer('hide', function() {
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
module.remove.clickaway();
module.remove.screenHeight(); module.remove.screenHeight();
} }
}); });
@ -523,6 +526,9 @@ $.fn.modal = function(parameters) {
: $module.is(':visible') : $module.is(':visible')
; ;
}, },
scrolling: function() {
return $dimmable.hasClass(className.scrolling);
},
modernBrowser: function() { modernBrowser: function() {
// appName for IE11 reports 'Netscape' can no longer use // appName for IE11 reports 'Netscape' can no longer use
return !(window.ActiveXObject || "ActiveXObject" in window); return !(window.ActiveXObject || "ActiveXObject" in window);
@ -556,9 +562,6 @@ $.fn.modal = function(parameters) {
.css('height', module.cache.height + settings.padding) .css('height', module.cache.height + settings.padding)
; ;
} }
else {
$body.css('height', '');
}
}, },
active: function() { active: function() {
$module.addClass(className.active); $module.addClass(className.active);
@ -570,7 +573,9 @@ $.fn.modal = function(parameters) {
type: function() { type: function() {
if(module.can.fit()) { if(module.can.fit()) {
module.verbose('Modal fits on screen'); module.verbose('Modal fits on screen');
module.remove.scrolling();
if(!module.othersActive) {
module.remove.scrolling();
}
} }
else { else {
module.verbose('Modal cannot fit on screen setting to scrolling'); module.verbose('Modal cannot fit on screen setting to scrolling');

Loading…
Cancel
Save