sandbox command reset

This commit is contained in:
Peter Cottle 2013-01-03 17:41:33 -08:00
parent d6e9b6a962
commit f4179e9723
9 changed files with 203 additions and 18 deletions

View file

@ -96,7 +96,8 @@ var Sandbox = Backbone.View.extend({
processSandboxCommand: function(command, deferred) {
var commandMap = {
help: this.helpDialog
help: this.helpDialog,
reset: this.reset
};
var method = commandMap[command.get('method')];
if (!method) { throw new Error('no method for that wut'); }
@ -104,6 +105,13 @@ var Sandbox = Backbone.View.extend({
method.apply(this, [command, deferred]);
},
reset: function(command, deferred) {
this.mainVis.reset();
setTimeout(function() {
command.finishWith(deferred);
}, this.mainVis.getAnimationTime());
},
helpDialog: function(command, deferred) {
var helpDialog = new MultiView({
childViews: require('../dialogs/sandbox').helpDialog