more hints/helps cleanup
This commit is contained in:
parent
c6f1c5cd2a
commit
24cf806787
@ -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() {
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user