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