From eafb7fcffea676fc8c98ca63b1c0ba155800e49f Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 13 May 2017 15:26:34 -0700 Subject: [PATCH] Improve editor appearance and use ctrl+enter for desc. --- .../etiquette_flask/templates/album.html | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/frontends/etiquette_flask/templates/album.html b/frontends/etiquette_flask/templates/album.html index 31365de..c2ae732 100644 --- a/frontends/etiquette_flask/templates/album.html +++ b/frontends/etiquette_flask/templates/album.html @@ -24,14 +24,14 @@ p width: 100%; max-width: 800px; } +#description_text +{ + padding: 8px; + background-color: rgba(0, 0, 0, 0.1); +} #description_editor textarea { width: 100%; - height: 100%; -} -#description_editor -{ - height: 100px; } .hidden { @@ -51,19 +51,19 @@ p Album {{album.id}} {% endif %} - -

{{album.description}}

+

{{album.description}}

+ {% set viewparam = "?view=list" if view == "list" else "" %} {% set parent = album.parent() %} @@ -134,6 +134,8 @@ var description_editor_box = document.getElementById("description_editor_box"); var edit_submitting_spinner = document.getElementById("edit_submitting_spinner"); bind_box_to_button(title_editor, save_button); +var ctrl_enter = true; +bind_box_to_button(description_editor_box, save_button, ctrl_enter); var title_is_blank = {{ (album.title == '')|int }}; var blank_title_text = "Album {{album.id}}"; @@ -169,7 +171,10 @@ function hide_editor() title_text.classList.remove("hidden"); title_editor.classList.add("hidden"); - description_text.classList.remove("hidden"); + if (description_text.innerText !== "") + { + description_text.classList.remove("hidden"); + } description_editor.classList.add("hidden"); }