Show disabled cancel button instead of removing it.

This fixes two problems caused by the removal of the button: Broken layout and broken JS
This commit is contained in:
Magnus Hovland Hoff 2018-09-16 22:25:28 +02:00
parent 999253a778
commit 534dffdfe3
2 changed files with 12 additions and 7 deletions

View file

@ -349,24 +349,26 @@ h1>input {
padding: 10px 0px;
margin-left: 10px;
}
.button[disabled] {
opacity: 0.5;
cursor: default;
}
.button:hover {
text-decoration: none;
}
.button:not([disabled]):hover, .button:not([disabled]):active {
background: var(--button-alt);
}
.button-cancel {
background: white;
color: var(--theme-main);
--button-alt: #f0f0f0;
}
.button-cancel:hover, .button-cancel:active {
background: #f0f0f0;
}
.button-default {
background: var(--theme-main);
color: var(--theme-text);
}
.button-default:hover, .button-default:active {
background: var(--theme-input);
--button-alt: var(--theme-input);
}
@media (min-width: 960px) {

View file

@ -27,6 +27,9 @@
<div class="editor-controls">
{{#cancel_url}}
<a class="button button-cancel cancel" href="{{.}}">Cancel</a>
{{/cancel_url}}
{{^cancel_url}}
<button class="button button-cancel cancel" disabled>Cancel</a>
{{/cancel_url}}
<button class="button button-default" type=submit>Save</button>
</div>