From 5559219f0a653e6a1ba6dff8a6fe8eb108653c83 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 21 Nov 2022 14:23:49 -0600 Subject: [PATCH] ui: hide DText "Formatting help" link in dialog boxes. Hide the "Formatting help" link for single-line DText fields in dialog boxes, such as after the "Reason" field in the flag, appeal, and report dialog boxes. --- app/javascript/src/styles/common/simple_form.scss | 14 +++++++++----- app/logical/dtext_input.rb | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/javascript/src/styles/common/simple_form.scss b/app/javascript/src/styles/common/simple_form.scss index 1b2ff82a0..a4110122b 100644 --- a/app/javascript/src/styles/common/simple_form.scss +++ b/app/javascript/src/styles/common/simple_form.scss @@ -154,14 +154,14 @@ form.one-line-form { } div.ui-dialog { - textarea, input[type="text"] { - width: 100%; - max-width: 100%; - } - form.simple_form { margin-bottom: 0; + textarea, input[type="text"] { + width: 100%; + max-width: 100%; + } + div.input { margin-bottom: 0.5em; } @@ -169,6 +169,10 @@ div.ui-dialog { div.input.hidden { display: none; } + + div.dtext-inline span.dtext-hint { + display: none; + } } /* the submit and close buttons */ diff --git a/app/logical/dtext_input.rb b/app/logical/dtext_input.rb index c0a2a9d98..784209155 100644 --- a/app/logical/dtext_input.rb +++ b/app/logical/dtext_input.rb @@ -18,7 +18,7 @@ class DtextInput < SimpleForm::Inputs::Base t = template merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) - t.tag.div(class: "dtext-previewable", spellcheck: true) do + t.tag.div(class: ["dtext-previewable", ("dtext-inline" if options[:inline])], spellcheck: true) do if options[:inline] t.concat @builder.text_field(attribute_name, merged_input_options) else