From 8180cc786f2f40dba7a0fc65489049acaf1d02ab Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Fri, 28 Apr 2023 12:30:39 -0500 Subject: [PATCH] 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. --- web/src/popover_menus.js | 4 ++-- web/templates/send_later_modal.hbs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/popover_menus.js b/web/src/popover_menus.js index 133ba80dd0..3652bca647 100644 --- a/web/src/popover_menus.js +++ b/web/src/popover_menus.js @@ -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(), ); diff --git a/web/templates/send_later_modal.hbs b/web/templates/send_later_modal.hbs index a0421b455a..355a8e55d9 100644 --- a/web/templates/send_later_modal.hbs +++ b/web/templates/send_later_modal.hbs @@ -26,6 +26,9 @@ {{this.text}} {{/each}} +
  • + {{t 'Custom time'}} +