From a73bf58d3693d5b78e26be4c6f461798456b0b56 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 3 May 2018 10:49:58 -0600 Subject: [PATCH] more hintview patching --- .../js/goatApp/controller/LessonController.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/webgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js b/webgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js index 662b67702..11b8279cf 100644 --- a/webgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js +++ b/webgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js @@ -126,11 +126,7 @@ define(['jquery', this.lessonContentView.model = this.lessonContent; this.lessonContentView.render(); //TODO: consider moving hintView as child of lessonContentView ... - if (this.lessonHintView) { - this.lessonHintView.stopListening(); - this.lessonHintView = null; - } - this.lessonHintView = new HintView(); + this.createLessonHintView(); //TODO: instantiate model with values (not sure why was not working before) var paramModel = new ParamModel({}); @@ -146,11 +142,23 @@ define(['jquery', this.lessonProgressModel.completed(); }; + this.createLessonHintView = function () { + if (this.lessonHintView) { + this.lessonHintView.stopListening(); + this.lessonHintView = null; + } + this.lessonHintView = new HintView(); + } + this.addCurHelpState = function (curHelp) { this.helpsLoaded[curHelp.helpElement] = curHelp.value; }; this.showHintsView = function() { + if (!this.lessonHintView) { + this.createLessonHintView(); + } + // this.lessonHintView.render(); if (this.lessonHintView.getHintsCount > 0) { this.helpControlsView.showHintsButton();