mirror of
https://github.com/e107inc/e107.git
synced 2025-07-29 10:50:25 +02:00
Issue #5192 Disable defer when in admin mode.
This commit is contained in:
@@ -1244,7 +1244,7 @@ class e_jsmanager
|
|||||||
case 'settings':
|
case 'settings':
|
||||||
|
|
||||||
|
|
||||||
if($this->_js_defer)
|
if($this->_js_defer && !$this->isInAdmin())
|
||||||
{
|
{
|
||||||
echo "<script src='".e_WEB_ABS."js/core/settings.jquery.php' defer></script>\n";
|
echo "<script src='".e_WEB_ABS."js/core/settings.jquery.php' defer></script>\n";
|
||||||
}
|
}
|
||||||
@@ -1495,7 +1495,7 @@ class e_jsmanager
|
|||||||
|
|
||||||
$path = $tp->replaceConstants($path, 'abs').'?external=1'; // &'.$this->getCacheId();
|
$path = $tp->replaceConstants($path, 'abs').'?external=1'; // &'.$this->getCacheId();
|
||||||
$path = $this->url($path);
|
$path = $this->url($path);
|
||||||
$defer = ($this->_js_defer) ? ' defer' : '';
|
$defer = ($this->_js_defer && !$this->isInAdmin()) ? ' defer' : '';
|
||||||
echo $pre.'<script src="'.$path.'"'.$defer.'></script>'.$post;
|
echo $pre.'<script src="'.$path.'"'.$defer.'></script>'.$post;
|
||||||
echo "\n";
|
echo "\n";
|
||||||
continue;
|
continue;
|
||||||
@@ -1595,7 +1595,7 @@ class e_jsmanager
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$defer = ($this->_js_defer && strpos($inline,'defer')===false) ? ' defer' : '';
|
$defer = ($this->_js_defer && !$this->isInAdmin() && strpos($inline,'defer')===false) ? ' defer' : '';
|
||||||
echo $pre.'<script src="'.$path.'"'.$inline.$defer.'></script>'.$post;
|
echo $pre.'<script src="'.$path.'"'.$inline.$defer.'></script>'.$post;
|
||||||
echo "\n";
|
echo "\n";
|
||||||
continue;
|
continue;
|
||||||
@@ -1771,7 +1771,7 @@ class e_jsmanager
|
|||||||
|
|
||||||
if($type == 'js')
|
if($type == 'js')
|
||||||
{
|
{
|
||||||
$deferCache = ($this->_js_defer) ? 'defer' : '';
|
$deferCache = ($this->_js_defer && !$this->isInAdmin()) ? 'defer' : '';
|
||||||
echo "<script src='".$this->url(e_WEB_ABS."cache/".$fileName,'js',false)."' $deferCache></script>\n\n";
|
echo "<script src='".$this->url(e_WEB_ABS."cache/".$fileName,'js',false)."' $deferCache></script>\n\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1992,9 +1992,9 @@ class e_jsmanager
|
|||||||
}
|
}
|
||||||
echo '<script>';
|
echo '<script>';
|
||||||
echo "\n//<![CDATA[\n";
|
echo "\n//<![CDATA[\n";
|
||||||
echo ($this->_js_defer) ? "window.onload = function(){\n" : '';
|
echo ($this->_js_defer && !$this->isInAdmin()) ? "window.onload = function(){\n" : '';
|
||||||
echo implode("\n\n", $content_array);
|
echo implode("\n\n", $content_array);
|
||||||
echo ($this->_js_defer) ? "};\n" : '';
|
echo ($this->_js_defer && !$this->isInAdmin()) ? "};\n" : '';
|
||||||
echo "\n//]]>\n";
|
echo "\n//]]>\n";
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
Reference in New Issue
Block a user