more hints/helps cleanup

This commit is contained in:
Jason 2017-10-25 18:05:08 -06:00
parent c6f1c5cd2a
commit 24cf806787
2 changed files with 12 additions and 2 deletions

View File

@ -102,12 +102,13 @@ define(['jquery',
hasSource:this.lessonInfoModel.get('hasSource') hasSource:this.lessonInfoModel.get('hasSource')
}); });
this.listenTo(this.helpControlsView,'hints:show',this.showHints); this.listenTo(this.helpControlsView,'hints:show',this.showHintsView);
this.listenTo(this.helpControlsView,'lesson:restart',this.restartLesson); this.listenTo(this.helpControlsView,'lesson:restart',this.restartLesson);
this.listenTo(this.developerControlsView, 'dev:labels', this.restartLesson); this.listenTo(this.developerControlsView, 'dev:labels', this.restartLesson);
this.helpControlsView.render(); this.helpControlsView.render();
this.showHintsView();
this.titleView.render(this.lessonInfoModel.get('lessonTitle')); this.titleView.render(this.lessonInfoModel.get('lessonTitle'));
}; };
@ -180,8 +181,13 @@ define(['jquery',
// } // }
// }; // };
this.showHints = function() { this.showHintsView = function() {
this.lessonHintView.render(); this.lessonHintView.render();
if (this.lessonHintView.getHintsCount > 0) {
this.helpControlsView.showHintsButton();
} else {
this.helpControlsView.hideHintsButton();
}
}; };
this.restartLesson = function() { this.restartLesson = function() {

View File

@ -126,6 +126,10 @@ function($,
} else { } else {
this.$el.find('#show-prev-hint').css('visibility','visible'); this.$el.find('#show-prev-hint').css('visibility','visible');
} }
},
getHintsCount: function () {
return this.collection.length;
} }
}); });