Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,22 @@ $(document).ready(function()
// Hide tooltips when a modal is opening, otherwise it might be overlapping it
oBodyElem.on('show.bs.modal', '.modal', function ()
{
$(this).find('.tooltip.in').tooltip('hide');

var $this = $(this);
$this.find('.tooltip.in').tooltip('hide');
// Set the z-index of the modal and its backdrop in case we have several modals opened
let zIndex = 1050 + (10 * $('.modal:visible').length);
$(this).css('z-index', zIndex);

$('.modal:visible').each(function (index) {
let current_zIndex = $(this).css('z-index');
if (current_zIndex >= zIndex) {
zIndex = parseInt(current_zIndex)+10;
}
});
$this.css('z-index', zIndex);
//Add the ability to drag and drop the pop-up
$this.find('.modal-dialog').draggable({
handle: ".modal-header"
});
// Set the z-index of the backdrop later because it is created after the modal
setTimeout(function() {
$('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');
Expand Down