diff --git a/src/commandModel.js b/src/commandModel.js index 3a8255fb..fc8f02ee 100644 --- a/src/commandModel.js +++ b/src/commandModel.js @@ -12,7 +12,7 @@ var Command = Backbone.Model.extend({ }, validateAtInit: function() { - if (!this.get('rawStr')) { + if (this.get('rawStr') === null) { throw new Error('Give me a string!'); } if (!this.get('createTime')) { diff --git a/src/commandViews.js b/src/commandViews.js index 97d39f26..d562851d 100644 --- a/src/commandViews.js +++ b/src/commandViews.js @@ -70,10 +70,7 @@ var CommandPromptView = Backbone.View.extend({ _.each(value.split(';'), _.bind(function(command) { command = command.replace(/^(\s+)/, ''); command = command.replace(/(\s+)$/, ''); - console.log('the command is', command); - if (command.length) { - this.addToCollection(command); - } + this.addToCollection(command); }, this)); }, diff --git a/src/git.js b/src/git.js index 02486a75..1dc37702 100644 --- a/src/git.js +++ b/src/git.js @@ -42,7 +42,10 @@ GitEngine.prototype.init = function() { this.commit(); // update tree - events.trigger('treeRefresh'); + // TODO make async, not async + setTimeout(function() { + events.trigger('treeRefresh'); + }, 100); }; GitEngine.prototype.getDetachedHead = function() { diff --git a/src/index.html b/src/index.html index 8b1798c8..87f09e1a 100644 --- a/src/index.html +++ b/src/index.html @@ -37,8 +37,8 @@ Learn Git Branching -