mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
got rid of every underscore bind i think -- 1500 line diff
This commit is contained in:
parent
3833319476
commit
2257668f9d
21 changed files with 229 additions and 230 deletions
|
@ -97,10 +97,10 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
|
||||
var whenHaveTree = Q.defer();
|
||||
HeadlessGit.getTreeQuick(this.options.beforeCommand, whenHaveTree);
|
||||
whenHaveTree.promise.then(_.bind(function(tree) {
|
||||
whenHaveTree.promise.then(function(tree) {
|
||||
this.mainVis.gitEngine.loadTree(tree);
|
||||
this.mainVis.gitVisuals.refreshTreeHarsh();
|
||||
}, this));
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
takeControl: function() {
|
||||
|
@ -142,11 +142,11 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
|
||||
var whenDone = Q.defer();
|
||||
this.dispatchCommand(this.JSON.command, whenDone);
|
||||
whenDone.promise.then(_.bind(function() {
|
||||
whenDone.promise.then(function() {
|
||||
this.$el.toggleClass('demonstrating', false);
|
||||
this.$el.toggleClass('demonstrated', true);
|
||||
this.releaseControl();
|
||||
}, this));
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
negative: function(e) {
|
||||
|
@ -168,11 +168,11 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
var chainPromise = chainDeferred.promise;
|
||||
|
||||
_.each(commands, function(command, index) {
|
||||
chainPromise = chainPromise.then(_.bind(function() {
|
||||
chainPromise = chainPromise.then(function() {
|
||||
var myDefer = Q.defer();
|
||||
this.mainVis.gitEngine.dispatch(command, myDefer);
|
||||
return myDefer.promise;
|
||||
}, this));
|
||||
}.bind(this));
|
||||
chainPromise = chainPromise.then(function() {
|
||||
return Q.delay(300);
|
||||
});
|
||||
|
@ -205,12 +205,12 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
show: function() {
|
||||
this.takeControl();
|
||||
if (this.visFinished) {
|
||||
setTimeout(_.bind(function() {
|
||||
setTimeout(function() {
|
||||
if (this.shown) {
|
||||
this.mainVis.setTreeIndex(300);
|
||||
this.mainVis.showHarsh();
|
||||
}
|
||||
}, this), this.getAnimationTime() * 1.5);
|
||||
}.bind(this), this.getAnimationTime() * 1.5);
|
||||
}
|
||||
|
||||
this.shown = true;
|
||||
|
@ -231,14 +231,14 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
smallCanvas: true,
|
||||
zIndex: -1
|
||||
});
|
||||
this.mainVis.customEvents.on('paperReady', _.bind(function() {
|
||||
this.mainVis.customEvents.on('paperReady', function() {
|
||||
this.visFinished = true;
|
||||
this.dispatchBeforeCommand();
|
||||
if (this.shown) {
|
||||
// show the canvas once its done if we are shown
|
||||
this.show();
|
||||
}
|
||||
}, this));
|
||||
}.bind(this));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue