mirror of
https://github.com/e107inc/e107.git
synced 2025-01-16 20:28:28 +01:00
Closes #5379 - Adds support for custom styling of modal windows in admin area.
This commit is contained in:
parent
e6775b5afd
commit
abda42015b
@ -31,6 +31,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
var caption = $this.attr('data-modal-caption');
|
var caption = $this.attr('data-modal-caption');
|
||||||
var height = ($(window).height() * 0.7) - 120;
|
var height = ($(window).height() * 0.7) - 120;
|
||||||
var target = $this.attr('data-modal-target');
|
var target = $this.attr('data-modal-target');
|
||||||
|
var customClass = $this.attr('data-modal-class');
|
||||||
|
|
||||||
if(caption === undefined)
|
if(caption === undefined)
|
||||||
{
|
{
|
||||||
@ -47,6 +48,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
$(target+' .modal-footer button[data-dismiss="modal"]').hide();
|
$(target+' .modal-footer button[data-dismiss="modal"]').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (customClass)
|
||||||
|
{
|
||||||
|
$(target + ' .modal-dialog').addClass(customClass);
|
||||||
|
}
|
||||||
|
|
||||||
$(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-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-caption').html(caption + ' <i id="e-modal-loading" class="fa fa-spin fa-spinner"></i>');
|
||||||
$(target+'.modal').modal('show');
|
$(target+'.modal').modal('show');
|
||||||
@ -88,7 +94,13 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(target).on('hidden.bs.modal', function ()
|
||||||
|
{
|
||||||
|
if (customClass)
|
||||||
|
{
|
||||||
|
$(target + ' .modal-dialog').removeClass(customClass);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user