From aa8f51713f34d3f57b44b3a2a9417a446a51184f Mon Sep 17 00:00:00 2001 From: Netz <49691921+Netz00@users.noreply.github.com> Date: Thu, 4 May 2023 20:28:57 +0200 Subject: [PATCH] #937 - Solution proposal --- src/js/views/gitDemonstrationView.js | 12 ++++++++++-- src/style/main.css | 10 +++++++++- src/template.index.html | 3 +++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/js/views/gitDemonstrationView.js b/src/js/views/gitDemonstrationView.js index 6d064940..ab901957 100644 --- a/src/js/views/gitDemonstrationView.js +++ b/src/js/views/gitDemonstrationView.js @@ -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)); }, diff --git a/src/style/main.css b/src/style/main.css index 4693bc39..0d6686c8 100644 --- a/src/style/main.css +++ b/src/style/main.css @@ -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 */ diff --git a/src/template.index.html b/src/template.index.html index 72e135fb..1878632b 100644 --- a/src/template.index.html +++ b/src/template.index.html @@ -155,6 +155,9 @@ --> <%= command.replace(' --aboveAll', '') %>
++ Reset +