Skip to content

Commit

Permalink
Fix minor issues in hint view
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-g authored and nbaars committed Jun 12, 2018
1 parent a7b8298 commit bae3e75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -90,9 +88,9 @@ function($,

hideHints: function() {
if (this.$el.is(':visible')) {
this.$el.hide(350);
this.$el.hide(350, this.toggleLabel.bind(this));
}
},
},

showNextHint: function() {
this.curHint = (this.curHint < this.hintsToShow.length -1) ? this.curHint+1 : this.curHint;
Expand All @@ -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();
Expand Down

0 comments on commit bae3e75

Please sign in to comment.