mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
boostrap modal options for frontend
A way to configure modal options documented here http://getbootstrap.com/javascript/#modals-methods
This commit is contained in:
@@ -402,7 +402,6 @@ $(document).ready(function()
|
||||
/* Bootstrap Modal window within an iFrame for frontend */
|
||||
$('.e-modal').on('click', function(e)
|
||||
{
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if($(this).attr('data-cache') == 'false')
|
||||
@@ -414,8 +413,22 @@ $(document).ready(function()
|
||||
|
||||
var url = $(this).attr('href');
|
||||
var caption = $(this).attr('data-modal-caption');
|
||||
var backdrop = $(this).attr('data-modal-backdrop');
|
||||
var keyboard = $(this).attr('data-modal-keyboard');
|
||||
var height = ($(window).height() * 0.7) - 120;
|
||||
|
||||
var modalOptions = {show: true};
|
||||
|
||||
if(backdrop !== undefined)
|
||||
{
|
||||
modalOptions['backdrop'] = backdrop;
|
||||
}
|
||||
|
||||
if(keyboard !== undefined)
|
||||
{
|
||||
modalOptions['keyboard'] = keyboard;
|
||||
}
|
||||
|
||||
if(caption === undefined)
|
||||
{
|
||||
caption = '';
|
||||
@@ -428,7 +441,7 @@ $(document).ready(function()
|
||||
|
||||
$('.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');
|
||||
$('.modal').modal(modalOptions);
|
||||
|
||||
$("#e-modal-iframe").on("load", function () {
|
||||
$('#e-modal-loading').hide();
|
||||
@@ -438,4 +451,4 @@ $(document).ready(function()
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user