Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_edit_history: Add support to open media in lightbox view.

Vector73810ec9b1706c
diff --git a/web/src/message_edit_history.ts b/web/src/message_edit_history.ts
index d13d1f21e3e..b2f26ba724c 100644
--- a/web/src/message_edit_history.ts
+++ b/web/src/message_edit_history.ts
@@ -8,6 +8,7 @@ import render_message_history_overlay from "../templates/message_history_overlay
import {exit_overlay} from "./browser_history.ts";
import * as channel from "./channel.ts";
import {$t, $t_html} from "./i18n.ts";
+import * as lightbox from "./lightbox.ts";
import * as loading from "./loading.ts";
import * as message_lists from "./message_lists.ts";
import type {Message} from "./message_store.ts";
@@ -408,4 +409,23 @@ export function initialize(): void {
messages_overlay_ui.activate_element(this, keyboard_handling_context);
},
);
+
+ $("body").on("click", "#message-history-overlay .message_edit_history_content", (e) => {
+ const $img = $(e.target).closest("img");
+ if ($img.length > 0) {
+ e.stopPropagation();
+ e.preventDefault();
+ overlays.close_overlay("message_edit_history");
+ lightbox.handle_inline_media_element_click($img, true);
+ return;
+ }
+
+ const $video = $(e.target).closest("video");
+ if ($video.length > 0) {
+ e.stopPropagation();
+ e.preventDefault();
+ overlays.close_overlay("message_edit_history");
+ lightbox.handle_inline_media_element_click($video, true);
+ }
+ });
}