mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +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));
|
||||
},
|
||||
|
||||
|
|
|
@ -1146,6 +1146,10 @@ div.gitDemonstrationView {
|
|||
opacity: 0;
|
||||
}
|
||||
|
||||
.gitDemonstrationView p.uiButton[target="reset"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gitDemonstrationView.demonstrated div.afterText {
|
||||
opacity: 1;
|
||||
}
|
||||
|
@ -1155,7 +1159,11 @@ div.gitDemonstrationView {
|
|||
}
|
||||
|
||||
.gitDemonstrationView.demonstrated p.uiButton {
|
||||
opacity: 0.4;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gitDemonstrationView.demonstrated p.uiButton[target="reset"] {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* LeftRightView */
|
||||
|
|
|
@ -155,6 +155,9 @@
|
|||
-->
|
||||
<%= command.replace(' --aboveAll', '') %>
|
||||
</p>
|
||||
<p class="uiButton uiButtonPink transitionOpacity" target="reset">
|
||||
Reset
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="afterText transitionOpacity">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue