-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for inconsistent padding of modals. Occuring when document…
… uses multiple scrollbars and overlapping modals are used.
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,19 @@ | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/@joeattardi/[email protected]/dist/index.min.js"></script> | ||
<script> | ||
/** | ||
* When documents has scrollbars, then bootstrap adds padding to compensate scrollbar wideness. | ||
* Nevertheless this mechanics behaviour is buggy when using overlapping modals. | ||
* Bootstrap dev team explicitly say that they not support overlapping modals. | ||
* Therefore this workaround is quite handy.*/ | ||
$(document).on('hidden.bs.modal', function () { | ||
if($('.modal.show').length) | ||
{ | ||
$('body').addClass('modal-open'); | ||
} | ||
}); | ||
</script> | ||
|
||
<!--OTHER REQUIREMENTS--> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css" /> | ||
|