mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
Objective button Resolves #168
This commit is contained in:
parent
e0516e3f5c
commit
5d05103afb
4 changed files with 32 additions and 5 deletions
|
@ -53,6 +53,7 @@ var Level = Sandbox.extend({
|
|||
this.on('toggleGoal', this.toggleGoal);
|
||||
this.on('minimizeCanvas', this.minimizeGoal);
|
||||
this.on('resizeCanvas', this.resizeGoal);
|
||||
this.on('toggleObjective', this.toggleObjective);
|
||||
|
||||
Level.__super__.initialize.apply(this, [options]);
|
||||
this.startOffCommand();
|
||||
|
@ -92,8 +93,6 @@ var Level = Sandbox.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
debugger;
|
||||
console.log(intl.getStartDialog(levelObj));
|
||||
var dialog = $.extend({}, intl.getStartDialog(levelObj));
|
||||
// grab the last slide only
|
||||
dialog.childViews = dialog.childViews.slice(-1);
|
||||
|
@ -268,6 +267,13 @@ var Level = Sandbox.extend({
|
|||
});
|
||||
},
|
||||
|
||||
toggleObjective: function() {
|
||||
Main.getEventBaton().trigger(
|
||||
'commandSubmitted',
|
||||
'objective'
|
||||
);
|
||||
},
|
||||
|
||||
toggleGoal: function () {
|
||||
if (this.goalCanvasHolder && this.goalCanvasHolder.inDom) {
|
||||
this.hideGoal();
|
||||
|
|
|
@ -567,11 +567,15 @@ var LevelToolbar = BaseView.extend({
|
|||
this.render();
|
||||
|
||||
this.$goalButton = this.$el.find('#show-goal');
|
||||
this.$objectiveButton = this.$el.find('#show-objective');
|
||||
|
||||
var parent = this.parent;
|
||||
this.$goalButton.on('click', function () {
|
||||
parent.trigger('toggleGoal');
|
||||
});
|
||||
this.$objectiveButton.on('click', function() {
|
||||
parent.trigger('toggleObjective');
|
||||
});
|
||||
|
||||
if (!options.wait) {
|
||||
process.nextTick(_.bind(this.show, this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue