mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 03:12:31 +00:00
Refactor video menus to overlay popovers
This commit is contained in:
1 parent
5928ede539
commit
7ef16cd004
6 files changed
+975
-529
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user