send_later: Pick time from 'Custom time' link.

This introduces a 'Custom time' link to the bottom of the scheduling
modal's options. Clicking on it pulls up the date picker.

Additionally, clicking on the 'Custom time' link, then clicking
elsewhere to close the time-picker, then subsequently clicking
'Custom time' again reveals the time-picker.

However, repeatedly clicking the 'Custom time' link while the
date-picker is already open will cause the date-picker to redraw
each time.
This commit is contained in:
Karl Stolley 2023-04-28 12:30:39 -05:00 committed by Tim Abbott
parent 865cba834b
commit 8180cc786f
2 changed files with 5 additions and 2 deletions

View File

@ -910,9 +910,9 @@ export function initialize() {
e.target.click();
}
});
$send_later_modal.one("click", ".send_later_date_input", (e) => {
$send_later_modal.on("click", ".send_later_custom", (e) => {
flatpickr.show_flatpickr(
$(".send_later_date_input")[0],
$(".send_later_custom")[0],
update_scheduled_date_from_modal,
new Date(),
);

View File

@ -26,6 +26,9 @@
<a id="{{@key}}" class="send_later_tomorrow" tabindex="0">{{this.text}}</a>
</li>
{{/each}}
<li>
<a class="send_later_custom" tabindex="0">{{t 'Custom time'}}</a>
</li>
</ul>
</div>
</main>