From fa0faecff06fb565d697c7273d3d8a28165076bb Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Tue, 27 May 2014 12:49:34 -0700 Subject: [PATCH] Resolves #177 fixes start vis in level builder with new click ability --- src/js/level/builder.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/js/level/builder.js b/src/js/level/builder.js index 69721c4b..b913ae88 100644 --- a/src/js/level/builder.js +++ b/src/js/level/builder.js @@ -62,7 +62,8 @@ var LevelBuilder = Level.extend({ initName: function() { this.levelToolbar = new LevelToolbar({ - name: intl.str('level-builder') + name: intl.str('level-builder'), + parent: this }); }, @@ -73,8 +74,36 @@ var LevelBuilder = Level.extend({ LevelBuilder.__super__.initGoalData.apply(this, arguments); }, + /** + * need custom handlers since we have two visualizations >___< + */ + minimizeGoal: function (position, size) { + this.doBothVis('hide'); + this.goalWindowPos = position; + this.goalWindowSize = size; + this.levelToolbar.$goalButton.text(intl.str('show-goal-button')); + if ($('#goalPlaceholder').is(':visible')) { + $('#goalPlaceholder').hide(); + this.mainVis.myResize(); + } + }, + + doBothVis: function(method) { + if (this.startVis) { + this.startVis[method].call(this.startVis); + } + if (this.goalVis) { + this.goalVis[method].call(this.goalVis); + } + }, + + resizeGoal: function () { + this.doBothVis('myResize'); + }, + initStartVisualization: function() { this.startCanvasHolder = new CanvasTerminalHolder({ + parent: this, additionalClass: 'startTree', text: intl.str('hide-start') });