From 49a425d439f41ad1df0e4663885c42cbdf45c674 Mon Sep 17 00:00:00 2001 From: Stanislas KITA Date: Mon, 25 Jan 2021 08:55:59 +0100 Subject: [PATCH] fix(js): move js load when tab is displayed --- inc/surveyanswer.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/surveyanswer.class.php b/inc/surveyanswer.class.php index 5f71297..000a7e6 100644 --- a/inc/surveyanswer.class.php +++ b/inc/surveyanswer.class.php @@ -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'); } @@ -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'];