Fix minor issues in hint view
This commit is contained in:
parent
a7b82985d4
commit
bae3e75ae2
@ -79,6 +79,7 @@ define(['jquery',
|
|||||||
this.listenTo(this.lessonHintView, 'hints:hideButton', this.onHideHintsButton);
|
this.listenTo(this.lessonHintView, 'hints:hideButton', this.onHideHintsButton);
|
||||||
this.lessonContentView.navToPage(pageNum);
|
this.lessonContentView.navToPage(pageNum);
|
||||||
this.lessonHintView.hideHints();
|
this.lessonHintView.hideHints();
|
||||||
|
this.lessonHintView.showFirstHint();
|
||||||
//this.lessonHintView.selectHints();
|
//this.lessonHintView.selectHints();
|
||||||
this.titleView.render(this.lessonInfoModel.get('lessonTitle'));
|
this.titleView.render(this.lessonInfoModel.get('lessonTitle'));
|
||||||
return;
|
return;
|
||||||
@ -160,7 +161,7 @@ define(['jquery',
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
this.lessonHintView.render();
|
this.lessonHintView.render();
|
||||||
if (this.lessonHintView.getHintsCount > 0) {
|
if (this.lessonHintView.getHintsCount() > 0) {
|
||||||
this.helpControlsView.showHintsButton();
|
this.helpControlsView.showHintsButton();
|
||||||
} else {
|
} else {
|
||||||
this.helpControlsView.hideHintsButton();
|
this.helpControlsView.hideHintsButton();
|
||||||
|
@ -32,21 +32,19 @@ function($,
|
|||||||
|
|
||||||
toggleLabel: function() {
|
toggleLabel: function() {
|
||||||
if (this.isVisible()) {
|
if (this.isVisible()) {
|
||||||
$('show-hints-button').text('Hide hints');
|
$('#show-hints-button').text('Hide hints');
|
||||||
} else {
|
} else {
|
||||||
$('show-hints-button').text('Show hints');
|
$('#show-hints-button').text('Show hints');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
render:function() {
|
render:function() {
|
||||||
if (this.isVisible()) {
|
if (this.isVisible()) {
|
||||||
this.$el.hide(350);
|
this.$el.hide(350, this.toggleLabel.bind(this));
|
||||||
} else if (this.hintsToShow.length > 0) {
|
} 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) {
|
if (this.hintsToShow.length > 0) {
|
||||||
this.hideShowPrevNextButtons();
|
this.hideShowPrevNextButtons();
|
||||||
}
|
}
|
||||||
@ -90,9 +88,9 @@ function($,
|
|||||||
|
|
||||||
hideHints: function() {
|
hideHints: function() {
|
||||||
if (this.$el.is(':visible')) {
|
if (this.$el.is(':visible')) {
|
||||||
this.$el.hide(350);
|
this.$el.hide(350, this.toggleLabel.bind(this));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
showNextHint: function() {
|
showNextHint: function() {
|
||||||
this.curHint = (this.curHint < this.hintsToShow.length -1) ? this.curHint+1 : this.curHint;
|
this.curHint = (this.curHint < this.hintsToShow.length -1) ? this.curHint+1 : this.curHint;
|
||||||
@ -106,6 +104,12 @@ function($,
|
|||||||
this.displayHint(this.curHint);
|
this.displayHint(this.curHint);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showFirstHint: function() {
|
||||||
|
this.curHint = 0;
|
||||||
|
this.hideShowPrevNextButtons();
|
||||||
|
this.displayHint(this.curHint);
|
||||||
|
},
|
||||||
|
|
||||||
displayHint: function(curHint) {
|
displayHint: function(curHint) {
|
||||||
if(this.hintsToShow.length == 0) {
|
if(this.hintsToShow.length == 0) {
|
||||||
// this.hideHints();
|
// this.hideHints();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user