Resolves #1058 -- dont show cancel button when in teaching mode

This commit is contained in:
Peter Cottle 2023-02-19 16:41:24 -07:00
parent e040e787ba
commit 0bec45844c
3 changed files with 11 additions and 5 deletions

View file

@ -140,7 +140,8 @@ var ConfirmCancelView = ResolveRejectBase.extend({
this.deferred = options.deferred || Q.defer(); this.deferred = options.deferred || Q.defer();
this.JSON = { this.JSON = {
confirm: options.confirm || intl.str('confirm-button'), confirm: options.confirm || intl.str('confirm-button'),
cancel: options.cancel || intl.str('cancel-button') cancel: options.cancel || intl.str('cancel-button'),
disableCancelButton: !!options.disableCancelButton,
}; };
this.render(); this.render();

View file

@ -142,7 +142,8 @@ var InteractiveRebaseView = ContainedBase.extend({
// finally get our buttons // finally get our buttons
new ConfirmCancelView({ new ConfirmCancelView({
destination: this.$('.confirmCancel'), destination: this.$('.confirmCancel'),
deferred: deferred deferred: deferred,
disableCancelButton: !!this.options.aboveAll,
}); });
} }
}); });

View file

@ -326,9 +326,13 @@
</script> </script>
<script type="text/html" id="confirm-cancel-template"> <script type="text/html" id="confirm-cancel-template">
<% if (disableCancelButton) { %>
<span></span>
<% } else { %>
<button class="noStyle box cancelButton uiButton uiButtonRed"> <button class="noStyle box cancelButton uiButton uiButtonRed">
<%= cancel %> <%= cancel %>
</button> </button>
<% } %>
<button class="noStyle box confirmButton uiButton uiButtonYellow"> <button class="noStyle box confirmButton uiButton uiButtonYellow">
<%= confirm %> <%= confirm %>
</button> </button>