diff --git a/build/bundle.js b/build/bundle.js index 6b0a345e..dec7b535 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -4601,6 +4601,7 @@ var Sandbox = Backbone.View.extend({ command.addWarning( "You aren't in a level! You are in a sandbox, start a level with `start level [id]`" ); + command.set('status', 'error'); deferred.resolve(); }, @@ -6606,6 +6607,7 @@ var Level = Sandbox.extend({ afterCB: _.bind(this.afterCommandCB, this), afterDeferHandler: _.bind(this.afterCommandDefer, this) }); + console.log('made my git shim'); }, getCommandsThatCount: function() { @@ -6826,11 +6828,12 @@ var Visualization = Backbone.View.extend({ // we want to add our canvas somewhere var container = options.containerElement || $('#canvasHolder')[0]; new Raphael(container, 200, 200, function() { - - // for some reason raphael calls this function with a predefined - // context... - // so switch it - _this.paperInitialize(this, options); + // raphael calls with paper as this for some inane reason... + var paper = this; + // use process.nextTick to go from sync to async + process.nextTick(function() { + _this.paperInitialize(paper, options); + }); }); }, @@ -18125,6 +18128,7 @@ var Level = Sandbox.extend({ afterCB: _.bind(this.afterCommandCB, this), afterDeferHandler: _.bind(this.afterCommandDefer, this) }); + console.log('made my git shim'); }, getCommandsThatCount: function() { @@ -18497,6 +18501,7 @@ var Sandbox = Backbone.View.extend({ command.addWarning( "You aren't in a level! You are in a sandbox, start a level with `start level [id]`" ); + command.set('status', 'error'); deferred.resolve(); }, @@ -22773,11 +22778,12 @@ var Visualization = Backbone.View.extend({ // we want to add our canvas somewhere var container = options.containerElement || $('#canvasHolder')[0]; new Raphael(container, 200, 200, function() { - - // for some reason raphael calls this function with a predefined - // context... - // so switch it - _this.paperInitialize(this, options); + // raphael calls with paper as this for some inane reason... + var paper = this; + // use process.nextTick to go from sync to async + process.nextTick(function() { + _this.paperInitialize(paper, options); + }); }); }, diff --git a/src/js/level/index.js b/src/js/level/index.js index ebabe6e6..bc3fc89c 100644 --- a/src/js/level/index.js +++ b/src/js/level/index.js @@ -227,6 +227,7 @@ var Level = Sandbox.extend({ afterCB: _.bind(this.afterCommandCB, this), afterDeferHandler: _.bind(this.afterCommandDefer, this) }); + console.log('made my git shim'); }, getCommandsThatCount: function() { diff --git a/src/js/level/sandbox.js b/src/js/level/sandbox.js index e22f8eb8..ec206d43 100644 --- a/src/js/level/sandbox.js +++ b/src/js/level/sandbox.js @@ -133,6 +133,7 @@ var Sandbox = Backbone.View.extend({ command.addWarning( "You aren't in a level! You are in a sandbox, start a level with `start level [id]`" ); + command.set('status', 'error'); deferred.resolve(); }, diff --git a/src/js/visuals/visualization.js b/src/js/visuals/visualization.js index de41b639..b3dbecb3 100644 --- a/src/js/visuals/visualization.js +++ b/src/js/visuals/visualization.js @@ -20,11 +20,12 @@ var Visualization = Backbone.View.extend({ // we want to add our canvas somewhere var container = options.containerElement || $('#canvasHolder')[0]; new Raphael(container, 200, 200, function() { - - // for some reason raphael calls this function with a predefined - // context... - // so switch it - _this.paperInitialize(this, options); + // raphael calls with paper as this for some inane reason... + var paper = this; + // use process.nextTick to go from sync to async + process.nextTick(function() { + _this.paperInitialize(paper, options); + }); }); },