yay ok working

This commit is contained in:
Peter Cottle 2013-01-05 15:53:42 -08:00
parent ebdf188c1d
commit eb33897a22
6 changed files with 166 additions and 17 deletions

View file

@ -38,6 +38,8 @@ var Sandbox = Backbone.View.extend({
return $('#mainVisSpace')[0];
},
getAnimationTime: function() { return 700 * 1.5; },
initVisualization: function(options) {
this.mainVis = new Visualization({
el: options.el || this.getDefaultVisEl()
@ -64,6 +66,9 @@ var Sandbox = Backbone.View.extend({
// we obviously take care of sandbox commands
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
// a few things to help transition between levels and sandbox
Main.getEventBaton().stealBaton('levelExited', this.levelExited, this);
this.insertGitShim();
},
@ -73,6 +78,11 @@ var Sandbox = Backbone.View.extend({
Main.getEventBaton().releaseBaton('commandSubmitted', this.commandSubmitted, this);
// we obviously take care of sandbox commands
Main.getEventBaton().releaseBaton('processSandboxCommand', this.processSandboxCommand, this);
console.log('just released two things about to...');
console.log(Main.getEventBaton());
// a few things to help transition between levels and sandbox
Main.getEventBaton().releaseBaton('levelExited', this.levelExited, this);
this.releaseGitShim();
},
@ -118,6 +128,18 @@ var Sandbox = Backbone.View.extend({
method.apply(this, [command, deferred]);
},
hide: function() {
this.mainVis.hide();
},
levelExited: function() {
this.show();
},
show: function() {
this.mainVis.show();
},
clear: function(command, deferred) {
Main.getEvents().trigger('clearOldCommands');
if (command && deferred) {