Fixes Issue #36

This commit is contained in:
Peter Cottle 2013-02-18 13:48:51 -08:00
parent c90444fe1e
commit 9cf91038c1
7 changed files with 48 additions and 18 deletions

View file

@ -134,8 +134,6 @@ var Level = Sandbox.extend({
el: options.el || this.getDefaultVisEl(),
treeString: options.level.startTree
});
this.initGoalVisualization();
},
initGoalVisualization: function() {
@ -153,6 +151,12 @@ var Level = Sandbox.extend({
});
},
onGoalVisualizationClick: function() {
// we need to destory this entire view whenever it is hidden so the scroll bar
// still works. unfortunately this
delete this.goalCanvasHolder;
},
showSolution: function(command, deferred) {
var toIssue = this.level.solutionCommand;
var issueFunc = function() {
@ -197,6 +201,9 @@ var Level = Sandbox.extend({
},
showGoal: function(command, defer) {
if (!this.goalCanvasHolder || !this.goalCanvasHolder.inDom) {
this.initGoalVisualization();
}
this.goalCanvasHolder.slideIn();
if (!command || !defer) { return; }
@ -206,7 +213,7 @@ var Level = Sandbox.extend({
},
hideGoal: function(command, defer) {
this.goalCanvasHolder.slideOut();
this.goalCanvasHolder.die();
if (!command || !defer) { return; }
setTimeout(function() {