mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
lightbox: Add tippy tooltip to lightbox title.
This commit adds a tippy tooltip to the lightbox title which enables the user to view the filename of an image if the filename is different than the image title. Fixes: #21333
This commit is contained in:
@@ -210,9 +210,11 @@ function display_image(payload) {
|
||||
img.src = payload.source;
|
||||
$img_container.html(img).show();
|
||||
|
||||
const filename = payload.url?.split("/").pop();
|
||||
$(".image-description .title")
|
||||
.text(payload.title || "N/A")
|
||||
.prop("title", payload.title || "N/A");
|
||||
.attr("aria-label", payload.title || "N/A")
|
||||
.prop("data-filename", filename || "N/A");
|
||||
$(".image-description .user").text(payload.user).prop("title", payload.user);
|
||||
|
||||
$(".image-actions .open, .image-actions .download").attr("href", payload.source);
|
||||
@@ -411,7 +413,7 @@ export function parse_image_data(image) {
|
||||
}
|
||||
const payload = {
|
||||
user: sender_full_name,
|
||||
title: $parent.attr("title"),
|
||||
title: $parent.attr("aria-label") || $parent.attr("href"),
|
||||
type,
|
||||
preview: preview_src,
|
||||
source,
|
||||
|
||||
Reference in New Issue
Block a user