From 534dffdfe39d31cdcc0d543efcbd19b753624394 Mon Sep 17 00:00:00 2001 From: Magnus Hovland Hoff Date: Sun, 16 Sep 2018 22:25:28 +0200 Subject: [PATCH] Show disabled cancel button instead of removing it. This fixes two problems caused by the removal of the button: Broken layout and broken JS --- assets/style.css | 16 +++++++++------- templates/article.html | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/assets/style.css b/assets/style.css index a465271..6a896fa 100644 --- a/assets/style.css +++ b/assets/style.css @@ -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) { diff --git a/templates/article.html b/templates/article.html index b511108..4f07039 100644 --- a/templates/article.html +++ b/templates/article.html @@ -27,6 +27,9 @@
{{#cancel_url}} Cancel +{{/cancel_url}} +{{^cancel_url}} +