Bug 31057: Add hint to the 'To date' input on the calendar form

Just adding a hint using the 'hint' class didn't work as
expected here. The hint was immediately hidden. That is
because of the collapsable hint text for the option at
the bottom of the form using the [?] link. So I chose to
use the class of the [$] to make the script a little more
selective.

To test:
* Go to the calendar tool
* Test that the [$] hide/show different help texts
* Apply patch
* Verify a hint now shows below the "To date"
* Verify that the help texts still function as before

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-02-09 22:36:13 +00:00 committed by Tomas Cohen Arazi
parent b3b33960da
commit b46220cbc7
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 3 additions and 2 deletions

View File

@ -175,6 +175,7 @@
<li class="dateinsert">
<strong>To date: </strong>
<input type="text" id="dateofrange" name="dateofrange" size="20" value="[% dateofrange | html %]" class="flatpickr" />
<div class="hint">This field only applies when holidays are added on a range.</div>
</li>
<li>
<label for="title">Title: </label>
@ -578,7 +579,7 @@
$(document).ready(function() {
$(".hint").hide();
$(".helptext + .hint").hide();
$("#branch").change(function(){
changeBranch();
});
@ -606,7 +607,7 @@
});
$("a.helptext").click(function(){
$(this).parent().find(".hint").toggle(); return false;
$(this).parent().find(".helptext + .hint").toggle(); return false;
});
const dateofrange = document.querySelector("#dateofrange")._flatpickr;