mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
drafts: Replace notification when saving a draft.
The old logic, inline in the compose area, has produced a very weird effect where the buttons would move to fit the notification, ever since design changes to use the full bottom row space. We address this by just using a Tippy tooltip instead.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {subDays} from "date-fns";
|
||||
import Handlebars from "handlebars/runtime";
|
||||
import $ from "jquery";
|
||||
import tippy from "tippy.js";
|
||||
|
||||
import render_draft_table_body from "../templates/draft_table_body.hbs";
|
||||
|
||||
@@ -137,8 +138,17 @@ export function restore_message(draft) {
|
||||
}
|
||||
|
||||
function draft_notify() {
|
||||
$(".alert-draft").css("display", "inline-block");
|
||||
$(".alert-draft").delay(1000).fadeOut(500);
|
||||
// Display a tooltip to notify the user about the saved draft.
|
||||
const instance = tippy(".compose_drafts_button", {
|
||||
content: $t({defaultMessage: "Saved as draft"}),
|
||||
arrow: true,
|
||||
placement: "top",
|
||||
})[0];
|
||||
instance.show();
|
||||
function remove_instance() {
|
||||
instance.destroy();
|
||||
}
|
||||
setTimeout(remove_instance, 1500);
|
||||
}
|
||||
|
||||
export function update_draft() {
|
||||
|
||||
Reference in New Issue
Block a user