Refactor video menus to overlay popovers

This commit is contained in:
thePR0M3TH3AN committed 2025-10-16 11:33:31 -04:00
1 parent 5928ede539
commit 7ef16cd004
6 files changed
+975 -529

No files matched your search

+48
View File
@@ -150,6 +150,22 @@ export class VideoListView {
: () => {},
closeAllMenus:
typeof utils.closeAllMenus === "function" ? utils.closeAllMenus : () => {},
requestMoreMenu:
typeof utils.requestMoreMenu === "function"
? utils.requestMoreMenu
: () => {},
closeMoreMenu:
typeof utils.closeMoreMenu === "function"
? utils.closeMoreMenu
: () => false,
requestSettingsMenu:
typeof utils.requestSettingsMenu === "function"
? utils.requestSettingsMenu
: () => {},
closeSettingsMenu:
typeof utils.closeSettingsMenu === "function"
? utils.closeSettingsMenu
: () => false,
};
this.renderedVideoIds = new Set();
@@ -504,6 +520,38 @@ export class VideoListView {
});
};
videoCard.onRequestMoreMenu = (detail = {}) => {
if (typeof this.utils.requestMoreMenu !== "function") {
return;
}
const payload = {
...detail,
video: detail.video || video,
pointerInfo: detail.pointerInfo || pointerInfo,
};
this.utils.requestMoreMenu(payload);
};
videoCard.onCloseMoreMenu = (detail = {}) => {
if (typeof this.utils.closeMoreMenu === "function") {
return this.utils.closeMoreMenu(detail);
}
return false;
};
videoCard.onRequestSettingsMenu = (detail = {}) => {
if (typeof this.utils.requestSettingsMenu === "function") {
this.utils.requestSettingsMenu(detail);
}
};
videoCard.onCloseSettingsMenu = (detail = {}) => {
if (typeof this.utils.closeSettingsMenu === "function") {
return this.utils.closeSettingsMenu(detail);
}
return false;
};
const cardEl = videoCard.getRoot();
if (!cardEl) {
return;