mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:57:43 +08:00
FIX: Error calling LazyYT from chat when disabled (#20085)
This commit is contained in:
@ -34,19 +34,20 @@ export default {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
api.decorateChatMessage(
|
||||
(element) => {
|
||||
element
|
||||
.querySelectorAll(".lazyYT:not(.lazyYT-video-loaded)")
|
||||
.forEach((iframe) => {
|
||||
$(iframe).lazyYT();
|
||||
});
|
||||
},
|
||||
{
|
||||
id: "lazy-yt",
|
||||
}
|
||||
);
|
||||
if (siteSettings.lazy_yt_enabled) {
|
||||
api.decorateChatMessage(
|
||||
(element) => {
|
||||
element
|
||||
.querySelectorAll(".lazyYT:not(.lazyYT-video-loaded)")
|
||||
.forEach((iframe) => {
|
||||
$(iframe).lazyYT();
|
||||
});
|
||||
},
|
||||
{
|
||||
id: "lazy-yt",
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
initialize(container) {
|
||||
|
Reference in New Issue
Block a user