mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-07 19:44:34 +02:00
#937 - Solution proposal
This commit is contained in:
parent
1723d9b0fc
commit
aa8f51713f
3 changed files with 22 additions and 3 deletions
|
@ -129,17 +129,25 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
},
|
||||
|
||||
positive: function() {
|
||||
if (this.demonstrated || !this.hasControl) {
|
||||
if (!this.hasControl) {
|
||||
// don't do anything if we are demonstrating, and if
|
||||
// we receive a meta nav event and we aren't listening,
|
||||
// then don't do anything either
|
||||
return;
|
||||
}
|
||||
|
||||
// already demonstrated, let's reset demonstration
|
||||
if(this.demonstrated) {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
this.demonstrated = true;
|
||||
this.demonstrate();
|
||||
},
|
||||
|
||||
demonstrate: function() {
|
||||
this.releaseControl();
|
||||
this.$el.toggleClass('demonstrating', true);
|
||||
|
||||
var whenDone = Q.defer();
|
||||
|
@ -147,7 +155,7 @@ var GitDemonstrationView = ContainedBase.extend({
|
|||
whenDone.promise.then(function() {
|
||||
this.$el.toggleClass('demonstrating', false);
|
||||
this.$el.toggleClass('demonstrated', true);
|
||||
this.releaseControl();
|
||||
this.takeControl();
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue