send_later: Cancel scheduling from popover.

This commit is contained in:
Karl Stolley 2023-04-28 11:04:10 -05:00 committed by Tim Abbott
parent e89cbf0ac1
commit 865cba834b
3 changed files with 12 additions and 12 deletions

View File

@ -930,16 +930,16 @@ export function initialize() {
e.stopPropagation(); e.stopPropagation();
}, },
); );
$send_later_modal.one("click", "#clear_compose_schedule_state", (e) => {
overlays.close_active_modal();
compose.reset_compose_scheduling_state(false);
e.preventDefault();
e.stopPropagation();
});
}, },
}); });
}); });
$popper.one("click", "#clear_compose_schedule_state", (e) => {
compose.reset_compose_scheduling_state(false);
// Close the popper instance when clearing scheduling:
instance.hide();
e.preventDefault();
e.stopPropagation();
});
}, },
onHidden(instance) { onHidden(instance) {
instance.destroy(); instance.destroy();

View File

@ -14,11 +14,6 @@
</div> </div>
<div class="send_later_options"> <div class="send_later_options">
<ul class="nav nav-list"> <ul class="nav nav-list">
{{#if formatted_send_later_time }}
<li>
<a id="clear_compose_schedule_state" tabindex="0">{{t "Now" }}</a>
</li>
{{/if}}
{{#if possible_send_later_today}} {{#if possible_send_later_today}}
{{#each possible_send_later_today}} {{#each possible_send_later_today}}
<li> <li>

View File

@ -2,6 +2,11 @@
<li> <li>
<a class="open_send_later_modal" tabindex="0">{{t "Schedule message" }}</a> <a class="open_send_later_modal" tabindex="0">{{t "Schedule message" }}</a>
</li> </li>
{{#if formatted_send_later_time }}
<li>
<a id="clear_compose_schedule_state" tabindex="0">{{t "Cancel scheduling" }}</a>
</li>
{{/if}}
<hr /> <hr />
<li> <li>
<a href="#scheduled" tabindex="0">{{t "View scheduled messages" }}</a> <a href="#scheduled" tabindex="0">{{t "View scheduled messages" }}</a>