Skip to content

Commit

Permalink
LSNBLDR-770 - Get modals on top of the rest of the markup (sakaiproje…
Browse files Browse the repository at this point in the history
…ct#3797)

* LSNBLDR-770 - Get modals on top of the rest of the markup

* LSNBLDR-770 - Fix PR comment
  • Loading branch information
csev authored Jan 25, 2017
1 parent 991bdd4 commit 3fdd624
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lessonbuilder/tool/src/webapp/templates/LtiImportItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ <h2 rsf:id="mainhead" id="mainhead"></h2>
$('#sakai-basiclti-launch-iframe').width('100%');
},
close: function() {
$('#modal-iframe-div').css('z-index',1);
$('.ui-dialog').css('z-index',1);
$('#sakai-basiclti-launch-iframe').attr('src','/library/image/sakai/spinner.gif');
}
});

var maxz = getMaxZIndex();

// In order to float above the BootStrap navigation
$('#modal-iframe-div').css('z-index',maxz+1);
$('.ui-dialog').css('z-index',maxz+1);

$(window).resize(function() {
$("#modal-iframe-div").dialog("option", "width", modalDialogWidth());
$('#sakai-basiclti-launch-iframe').width('100%');
Expand Down
15 changes: 15 additions & 0 deletions reference/library/src/webapp/js/headscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,3 +809,18 @@ function modalDialogWidth() {
if ( dWidth < 300 ) dWidth = 300; // Should not happen
return Math.round(dWidth);
}

// Figure out the maximum z-index
// http://stackoverflow.com/questions/1118198/how-can-you-figure-out-the-highest-z-index-in-your-document
function maxZIndex(elems)
{
var maxIndex = 0;
elems = typeof elems !== 'undefined' ? elems : $("*");

$(elems).each(function(){
maxIndex = (parseInt(maxIndex) < parseInt($(this).css('z-index'))) ? parseInt($(this).css('z-index')) : maxIndex;
});

return maxIndex;
}

0 comments on commit 3fdd624

Please sign in to comment.