mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
sandbox command reset
This commit is contained in:
parent
d6e9b6a962
commit
f4179e9723
9 changed files with 203 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue