diff --git a/src/js/level/index.js b/src/js/level/index.js index 4b10adf2..b4d3fa79 100644 --- a/src/js/level/index.js +++ b/src/js/level/index.js @@ -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(); diff --git a/src/js/views/index.js b/src/js/views/index.js index 5972b256..5a915fd9 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -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)); diff --git a/src/style/main.css b/src/style/main.css index 39ad2184..e7369987 100644 --- a/src/style/main.css +++ b/src/style/main.css @@ -329,6 +329,7 @@ div.toolbar.level-toolbar { border-radius: 0; height: inherit; font-size: 12px; + position: relative; } div.toolbar.level-toolbar button { @@ -359,6 +360,17 @@ div.toolbar div.showGoalWrapper { margin-left: 6px; } +div.toolbar div.showObjectiveWrapper { + float: right; + margin-right: 6px; +} + +div.toolbar div.buttonsWrapper { + position: absolute; + width: 100%; + top: 10px; +} + div.toolbar div.levelNameWrapper { text-align: center; position: relative; diff --git a/src/template.index.html b/src/template.index.html index 18edbe7f..c88b33d9 100644 --- a/src/template.index.html +++ b/src/template.index.html @@ -144,9 +144,6 @@