1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Corrected frontend modal markup. Corrected page registry identifier.

This commit is contained in:
Cameron
2016-02-28 20:50:09 -08:00
parent 56082cf072
commit 8c0680a18a
6 changed files with 66 additions and 14 deletions

View File

@@ -396,6 +396,46 @@ $(document).ready(function()
return true;
});
/* Bootstrap Modal window within an iFrame for frontend */
$('.e-modal').on('click', function(e)
{
e.preventDefault();
if($(this).attr('data-cache') == 'false')
{
$('#uiModal').on('shown.bs.modal', function () {
$(this).removeData('bs.modal');
});
}
var url = $(this).attr('href');
var caption = $(this).attr('data-modal-caption');
var height = ($(window).height() * 0.7) - 120;
if(caption === undefined)
{
caption = '';
}
if($(this).attr('data-modal-height') !== undefined)
{
height = $(this).attr('data-modal-height');
}
$('.modal-body').html('<div><iframe id="e-modal-iframe" width="100%" height="'+height+'px" frameborder="0" scrolling="auto" style="display:block;" 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');
$("#e-modal-iframe").on("load", function () {
$('#e-modal-loading').hide();
});
});
});