Skip to content

Commit

Permalink
Add context menu to wall page
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed Nov 24, 2024
1 parent 627ce66 commit 3cff5c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/J.Server/WallPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function createVideoElement(index) {
const video = document.createElement('video');
video.loop = true;
video.muted = true;
video.style.display = 'none';
const source = document.createElement('source');
source.src = videoData.url;
Expand All @@ -182,6 +181,11 @@ function createVideoElement(index) {
cell.appendChild(video);
cell.appendChild(titleBar);
cell.addEventListener('contextmenu', (event) => {
event.preventDefault();
menu([videoData.id]);
});
return cell;
}
Expand Down Expand Up @@ -210,7 +214,6 @@ function updateVisibleVideos() {
const video = element.querySelector('video');
if (video) {
video.pause();
video.style.display = 'none';
}
element.remove();
activeVideos.delete(key);
Expand All @@ -226,7 +229,6 @@ function updateVisibleVideos() {
activeVideos.set(i.toString(), cell);
const video = cell.querySelector('video');
if (video) {
video.style.display = 'block';
video.play().catch(() => {});
}
}
Expand Down

0 comments on commit 3cff5c1

Please sign in to comment.