1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Prevent e-modal conflict with other modals. (also supports data-modal-target attribute)

This commit is contained in:
Cameron
2020-03-26 15:30:09 -07:00
parent f4b4ba61d5
commit 3173c9c173
2 changed files with 12 additions and 6 deletions

View File

@@ -30,16 +30,21 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
var url = $this.attr('href');
var caption = $this.attr('data-modal-caption');
var height = ($(window).height() * 0.7) - 120;
var target = $this.attr('data-modal-target');
if(caption === undefined)
{
caption = '';
}
$('.modal-body').html('<div class="well"><iframe id="e-modal-iframe" width="100%" height="' + height + 'px" frameborder="0" scrolling="auto" style="display:block;background-color:transparent" allowtransparency="true" src="' + url + '"></iframe></div>');
$('.modal-caption').html(caption + ' <i id="e-modal-loading" class="fa fa-spin fa-spinner"></i>');
$('.modal').modal('show');
if(target === undefined)
{
target = '#uiModal';
}
$(target+' .modal-body').html('<div class="well"><iframe id="e-modal-iframe" width="100%" height="' + height + 'px" frameborder="0" scrolling="auto" style="display:block;background-color:transparent" allowtransparency="true" src="' + url + '"></iframe></div>');
$(target+' .modal-caption').html(caption + ' <i id="e-modal-loading" class="fa fa-spin fa-spinner"></i>');
$(target+'.modal').modal('show');
$("#e-modal-iframe").on("load", function ()
{