mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Prevent e-modal conflict with other modals. (also supports data-modal-target attribute)
This commit is contained in:
@@ -4309,6 +4309,7 @@ var_dump($select_options);*/
|
||||
$cnt = 0;
|
||||
$text = '';
|
||||
|
||||
|
||||
foreach ($fieldarray as $field => $data)
|
||||
{
|
||||
|
||||
@@ -4323,11 +4324,11 @@ var_dump($select_options);*/
|
||||
*/
|
||||
|
||||
//Not found
|
||||
if((!varset($data['forced']) && !in_array($field, $currentlist)) || varset($data['nolist']))
|
||||
if((empty($data['forced']) && !in_array($field, $currentlist)) || !empty($data['nolist']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
elseif(vartrue($data['type']) != 'method' && !$data['forced'] && !isset($fieldvalues[$field]) && $fieldvalues[$field] !== NULL)
|
||||
elseif(vartrue($data['type']) != 'method' && empty($data['forced']) && !isset($fieldvalues[$field]) && $fieldvalues[$field] !== null)
|
||||
{
|
||||
$text .= "
|
||||
<td>
|
||||
|
@@ -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 ()
|
||||
{
|
||||
|
Reference in New Issue
Block a user