mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use click once for video place holder (#24141)
Rather than removing the event listener just use `{once: true}`.
docs: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once
meta: https://meta.discourse.org/t/283596
This commit is contained in:
@@ -13,7 +13,6 @@ export default {
|
||||
const overlay = wrapper.querySelector(".video-placeholder-overlay");
|
||||
|
||||
parentDiv.style.cursor = "";
|
||||
parentDiv.removeEventListener("click", handleVideoPlaceholderClick);
|
||||
overlay.innerHTML = spinnerHTML;
|
||||
|
||||
const videoHTML = `
|
||||
@@ -83,7 +82,7 @@ export default {
|
||||
container.addEventListener(
|
||||
"click",
|
||||
handleVideoPlaceholderClick.bind(null, helper),
|
||||
false
|
||||
{ once: true }
|
||||
);
|
||||
overlay.innerHTML = `${iconHTML("play")}`;
|
||||
wrapper.appendChild(overlay);
|
||||
|
||||
Reference in New Issue
Block a user