mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 04:40:44 +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 */
|
/* Bootstrap Modal window within an iFrame for frontend */
|
||||||
$('.e-modal').on('click', function(e)
|
$('.e-modal').on('click', function(e)
|
||||||
{
|
{
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if($(this).attr('data-cache') == 'false')
|
if($(this).attr('data-cache') == 'false')
|
||||||
@@ -414,8 +413,22 @@ $(document).ready(function()
|
|||||||
|
|
||||||
var url = $(this).attr('href');
|
var url = $(this).attr('href');
|
||||||
var caption = $(this).attr('data-modal-caption');
|
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 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)
|
if(caption === undefined)
|
||||||
{
|
{
|
||||||
caption = '';
|
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-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-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-iframe").on("load", function () {
|
||||||
$('#e-modal-loading').hide();
|
$('#e-modal-loading').hide();
|
||||||
@@ -438,4 +451,4 @@ $(document).ready(function()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user