more hintview patching

This commit is contained in:
Jason 2018-05-03 10:49:58 -06:00 committed by Nanne Baars
parent 0ff6000511
commit a73bf58d36

View File

@ -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();