Skip to content

Commit

Permalink
fix(js): move js load when tab is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and cedric-anne committed Sep 7, 2021
1 parent d59094e commit 49a425d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions inc/surveyanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {

// can exists for template
if ($item->getType() == 'PluginSatisfactionSurvey') {
echo Html::css('public/lib/jquery.rateit.css');
Html::requireJs('rateit');
return __('Preview', 'satisfaction');
}

Expand Down Expand Up @@ -268,9 +270,6 @@ static function displayAnswer($question, $value = 0) {
* @param int $value
*/
static function showStarAnswer($question, $value = 0) {
echo Html::css('public/lib/jquery.rateit.css');
Html::requireJs('rateit');

$questions_id = $question['id'];
$number = $question['number'];

Expand Down

0 comments on commit 49a425d

Please sign in to comment.