Skip to content

Commit

Permalink
fix(modal): fade inner dimmer
Browse files Browse the repository at this point in the history
On multiple modals, when you close the second mdal, the dimmer of first modal did not fade out nicely
  • Loading branch information
lubber-de committed Mar 12, 2023
1 parent e35f5d7 commit 4006122
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/definitions/modules/modal.js
Expand Up @@ -620,7 +620,7 @@
ignoreRepeatedEvents = false;
if (settings.allowMultiple) {
if (module.others.active()) {
$otherModals.filter('.' + className.active).find(selector.dimmer).addClass('active');
$otherModals.filter('.' + className.active).find(selector.dimmer).removeClass('out').addClass('transition fade in active');
}

if (settings.detachable) {
Expand Down Expand Up @@ -692,6 +692,8 @@
onStart: function () {
if (!module.others.active() && !module.others.animating() && !keepDimmed) {
module.hideDimmer();
} else if (settings.allowMultiple) {
(hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('in').addClass('out');
}
if (settings.keyboardShortcuts && !module.others.active()) {
module.remove.keyboardShortcuts();
Expand All @@ -704,11 +706,7 @@
$previousModal.addClass(className.front);
$module.removeClass(className.front);

if (hideOthersToo) {
$allModals.find(selector.dimmer).removeClass('active');
} else {
$previousModal.find(selector.dimmer).removeClass('active');
}
(hideOthersToo ? $allModals : $previousModal).find(selector.dimmer).removeClass('active');
}
if (isFunction(settings.onHidden)) {
settings.onHidden.call(element);
Expand Down

0 comments on commit 4006122

Please sign in to comment.