Skip to content

Commit 49a425d

Browse files
stonebuzzcedric-anne
authored andcommitted
fix(js): move js load when tab is displayed
1 parent d59094e commit 49a425d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

inc/surveyanswer.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
4040

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

@@ -268,9 +270,6 @@ static function displayAnswer($question, $value = 0) {
268270
* @param int $value
269271
*/
270272
static function showStarAnswer($question, $value = 0) {
271-
echo Html::css('public/lib/jquery.rateit.css');
272-
Html::requireJs('rateit');
273-
274273
$questions_id = $question['id'];
275274
$number = $question['number'];
276275

0 commit comments

Comments
 (0)