Skip to content

Commit

Permalink
Dev: check if called via ajax before including jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 27, 2016
1 parent 58e7048 commit cf0c793
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions application/models/AdminTheme.php
Expand Up @@ -133,12 +133,16 @@ public function registerStylesAndScripts()
// and move the rest to the bootstrap package.
// NB: registerAllScripts could be replaced by js definition in package. If needed: not a problem to do it

Yii::app()->getClientScript()->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport'); // See: https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/bootstrap/components/TbApi.php#l108-l115
App()->bootstrap->registerAllScripts(); // See : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/bootstrap/components/TbApi.php#l153-l160
if (!Yii::app()->request->isAjaxRequest)
{
Yii::app()->getClientScript()->registerMetaTag('width=device-width, initial-scale=1.0', 'viewport'); // See: https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/bootstrap/components/TbApi.php#l108-l115
App()->bootstrap->registerAllScripts(); // See : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/extensions/bootstrap/components/TbApi.php#l153-l160

App()->getClientScript()->registerPackage('jqueryui'); // jqueryui
App()->getClientScript()->registerPackage('jquery-cookie'); // jquery-cookie
App()->getClientScript()->registerPackage('fontawesome'); // fontawesome ??? TODO: check if needed
App()->getClientScript()->registerPackage('jqueryui'); // jqueryui
App()->getClientScript()->registerPackage('jquery-cookie'); // jquery-cookie
App()->getClientScript()->registerPackage('fontawesome'); // fontawesome ??? TODO: check if needed

}

$aCssFiles = array();
$aJsFiles= array();
Expand Down

0 comments on commit cf0c793

Please sign in to comment.