mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
lightbox: Set data-filename as an attribute, not an invalid property.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
f07ed8b6b3
commit
518daff9db
@@ -258,7 +258,7 @@ function display_image(payload: Payload): void {
|
|||||||
$(".media-description .title")
|
$(".media-description .title")
|
||||||
.text(payload.title ?? "N/A")
|
.text(payload.title ?? "N/A")
|
||||||
.attr("aria-label", payload.title ?? "N/A")
|
.attr("aria-label", payload.title ?? "N/A")
|
||||||
.prop("data-filename", filename ?? "N/A");
|
.attr("data-filename", filename ?? "N/A");
|
||||||
if (payload.user !== undefined) {
|
if (payload.user !== undefined) {
|
||||||
$(".media-description .user").text(payload.user).prop("title", payload.user);
|
$(".media-description .user").text(payload.user).prop("title", payload.user);
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ function display_video(payload: Payload): void {
|
|||||||
$(".media-description .title")
|
$(".media-description .title")
|
||||||
.text(payload.title ?? "N/A")
|
.text(payload.title ?? "N/A")
|
||||||
.attr("aria-label", payload.title ?? "N/A")
|
.attr("aria-label", payload.title ?? "N/A")
|
||||||
.prop("data-filename", filename ?? "N/A");
|
.attr("data-filename", filename ?? "N/A");
|
||||||
if (payload.user !== undefined) {
|
if (payload.user !== undefined) {
|
||||||
$(".media-description .user").text(payload.user).prop("title", payload.user);
|
$(".media-description .user").text(payload.user).prop("title", payload.user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ export function initialize(): void {
|
|||||||
if (title === undefined) {
|
if (title === undefined) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const filename = $(instance.reference).prop("data-filename");
|
const filename = $(instance.reference).attr("data-filename");
|
||||||
const $markup = $("<span>").text(title);
|
const $markup = $("<span>").text(title);
|
||||||
if (title !== filename) {
|
if (title !== filename) {
|
||||||
// If the image title is the same as the filename, there's no reason
|
// If the image title is the same as the filename, there's no reason
|
||||||
|
|||||||
Reference in New Issue
Block a user