This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
UTPass-Website/mdb/js/modules/enhanced-modals.js
2019-09-15 13:19:29 +02:00

28 lines
685 B
JavaScript

/*
Enhanced Bootstrap Modals
https://mdbootstrap.com
office@mdbootstrap.com
*/
(function($){
$('body').on('shown.bs.modal', '.modal', function() {
if(!$('.modal-backdrop').length) {
$modal_dialog = $(this).children('.modal-dialog')
if($modal_dialog.hasClass('modal-side')) {
$(this).addClass('modal-scrolling');
$('body').addClass('scrollable');
}
if($modal_dialog.hasClass('modal-frame')) {
$(this).addClass('modal-content-clickable');
$('body').addClass('scrollable');
}
}
});
$('body').on('hidden.bs.modal', '.modal', function() {
$('body').removeClass('scrollable');
});
})(jQuery);