more hintview patching

This commit is contained in:
Jason 2018-05-03 10:49:58 -06:00
parent 089dd56a15
commit 186f24f1df

View File

@ -126,11 +126,7 @@ define(['jquery',
this.lessonContentView.model = this.lessonContent; this.lessonContentView.model = this.lessonContent;
this.lessonContentView.render(); this.lessonContentView.render();
//TODO: consider moving hintView as child of lessonContentView ... //TODO: consider moving hintView as child of lessonContentView ...
if (this.lessonHintView) { this.createLessonHintView();
this.lessonHintView.stopListening();
this.lessonHintView = null;
}
this.lessonHintView = new HintView();
//TODO: instantiate model with values (not sure why was not working before) //TODO: instantiate model with values (not sure why was not working before)
var paramModel = new ParamModel({}); var paramModel = new ParamModel({});
@ -146,11 +142,23 @@ define(['jquery',
this.lessonProgressModel.completed(); this.lessonProgressModel.completed();
}; };
this.createLessonHintView = function () {
if (this.lessonHintView) {
this.lessonHintView.stopListening();
this.lessonHintView = null;
}
this.lessonHintView = new HintView();
}
this.addCurHelpState = function (curHelp) { this.addCurHelpState = function (curHelp) {
this.helpsLoaded[curHelp.helpElement] = curHelp.value; this.helpsLoaded[curHelp.helpElement] = curHelp.value;
}; };
this.showHintsView = function() { this.showHintsView = function() {
if (!this.lessonHintView) {
this.createLessonHintView();
}
//
this.lessonHintView.render(); this.lessonHintView.render();
if (this.lessonHintView.getHintsCount > 0) { if (this.lessonHintView.getHintsCount > 0) {
this.helpControlsView.showHintsButton(); this.helpControlsView.showHintsButton();