Fix minor issues in hint view

This commit is contained in:
Matthias Grundmann 2018-06-11 16:43:16 +02:00 committed by Nanne Baars
parent a7b82985d4
commit bae3e75ae2
2 changed files with 14 additions and 9 deletions

View File

@ -79,6 +79,7 @@ define(['jquery',
this.listenTo(this.lessonHintView, 'hints:hideButton', this.onHideHintsButton);
this.lessonContentView.navToPage(pageNum);
this.lessonHintView.hideHints();
this.lessonHintView.showFirstHint();
//this.lessonHintView.selectHints();
this.titleView.render(this.lessonInfoModel.get('lessonTitle'));
return;
@ -160,7 +161,7 @@ define(['jquery',
}
//
this.lessonHintView.render();
if (this.lessonHintView.getHintsCount > 0) {
if (this.lessonHintView.getHintsCount() > 0) {
this.helpControlsView.showHintsButton();
} else {
this.helpControlsView.hideHintsButton();

View File

@ -32,21 +32,19 @@ function($,
toggleLabel: function() {
if (this.isVisible()) {
$('show-hints-button').text('Hide hints');
$('#show-hints-button').text('Hide hints');
} else {
$('show-hints-button').text('Show hints');
$('#show-hints-button').text('Show hints');
}
},
render:function() {
if (this.isVisible()) {
this.$el.hide(350);
this.$el.hide(350, this.toggleLabel.bind(this));
} else if (this.hintsToShow.length > 0) {
this.$el.show(350);
this.$el.show(350, this.toggleLabel.bind(this));
}
this.toggleLabel()
if (this.hintsToShow.length > 0) {
this.hideShowPrevNextButtons();
}
@ -90,7 +88,7 @@ function($,
hideHints: function() {
if (this.$el.is(':visible')) {
this.$el.hide(350);
this.$el.hide(350, this.toggleLabel.bind(this));
}
},
@ -106,6 +104,12 @@ function($,
this.displayHint(this.curHint);
},
showFirstHint: function() {
this.curHint = 0;
this.hideShowPrevNextButtons();
this.displayHint(this.curHint);
},
displayHint: function(curHint) {
if(this.hintsToShow.length == 0) {
// this.hideHints();