Skip to content

Commit

Permalink
Correct place to call 'behavior.core'
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Aug 19, 2016
1 parent 52df008 commit 14151a3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libraries/joomla/document/renderer/html/head.php
Expand Up @@ -53,17 +53,15 @@ public function fetchHead($document)
$document->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['name']['tags']));
}

$scriptOptions = $document->getScriptOptions();
// Trigger the onBeforeCompileHead event
$app = JFactory::getApplication();
$app->triggerEvent('onBeforeCompileHead');

if (!empty($scriptOptions))
if ($document->getScriptOptions())
{
JHtml::_('behavior.core');
}

// Trigger the onBeforeCompileHead event
$app = JFactory::getApplication();
$app->triggerEvent('onBeforeCompileHead');

// Get line endings
$lnEnd = $document->_getLineEnd();
$tab = $document->_getTab();
Expand Down Expand Up @@ -227,6 +225,8 @@ public function fetchHead($document)
}

// Generate scripts options
$scriptOptions = $document->getScriptOptions();

if (!empty($scriptOptions))
{
$buffer .= $tab . '<script type="text/joomla-script-options" id="joomla-script-options">';
Expand Down

0 comments on commit 14151a3

Please sign in to comment.