Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_edit_history: Prevent overlay when no edit history exists.
Pritesh Shettye29e9678a93a
diff --git a/web/src/message_edit_history.ts b/web/src/message_edit_history.tsindex 1aa19bd227e..93e1b531b9e 100644--- a/web/src/message_edit_history.ts+++ b/web/src/message_edit_history.ts@@ -351,27 +351,35 @@ export function handle_keyboard_events(event_key: string): void {}export function initialize(): void {- $("body").on("mouseenter", ".message_edit_notice, .edit-notifications", (e) => {- if (- realm.realm_message_edit_history_visibility_policy !==- message_edit_history_visibility_policy_values.never.code- ) {- $(e.currentTarget).addClass("message_edit_notice_hover");- }- });+ $("body").on(+ "mouseenter",+ ".message_edit_notice, .edit-notifications.has-edit-history",+ (e) => {+ if (+ realm.realm_message_edit_history_visibility_policy !==+ message_edit_history_visibility_policy_values.never.code+ ) {+ $(e.currentTarget).addClass("message_edit_notice_hover");+ }+ },+ );- $("body").on("mouseleave", ".message_edit_notice, .edit-notifications", (e) => {- if (- realm.realm_message_edit_history_visibility_policy !==- message_edit_history_visibility_policy_values.never.code- ) {- $(e.currentTarget).removeClass("message_edit_notice_hover");- }- });+ $("body").on(+ "mouseleave",+ ".message_edit_notice, .edit-notifications.has-edit-history",+ (e) => {+ if (+ realm.realm_message_edit_history_visibility_policy !==+ message_edit_history_visibility_policy_values.never.code+ ) {+ $(e.currentTarget).removeClass("message_edit_notice_hover");+ }+ },+ );$("body").on("click",- ".message_edit_notice, .edit-notifications",+ ".message_edit_notice, .edit-notifications.has-edit-history",function (this: HTMLElement, e) {e.stopPropagation();e.preventDefault();diff --git a/web/styles/message_row.css b/web/styles/message_row.cssindex 4ba943e508a..d2ddf9a1f0f 100644--- a/web/styles/message_row.css+++ b/web/styles/message_row.css@@ -1095,6 +1095,10 @@cursor: pointer;}+.edit-notifications.has-edit-history {+ cursor: pointer;+}+.fade-in-message {animation-name: fadeInMessage;animation-duration: 1s;diff --git a/web/templates/edited_notice.hbs b/web/templates/edited_notice.hbsindex f2a372a2b20..c2789132b62 100644--- a/web/templates/edited_notice.hbs+++ b/web/templates/edited_notice.hbs@@ -1,4 +1,4 @@-<div class="edit-notifications"></div>+<div class="edit-notifications{{#if modified}} has-edit-history{{/if}}"></div>{{#if modified}}{{#unless (eq msg/local_edit_timestamp undefined)}}<div class="message_edit_notice">