also remove video from the dom
This commit is contained in:
@@ -814,7 +814,19 @@ App.videos = App.videos || {};
|
||||
if (el) { el.innerHTML = ''; el.style.height = '0px'; }
|
||||
};
|
||||
|
||||
return { ensureInit, packFrom, update: scheduleUpdate, relayout, reset };
|
||||
// Removes a single video's card from the grid: its DOM element is
|
||||
// unmounted directly (so it's gone even if the re-pack below can't run),
|
||||
// then the remaining cards are re-packed against the now-shorter queue.
|
||||
// The caller must have already removed the video from state.loadedVideos.
|
||||
const removeVideo = function(videoId) {
|
||||
const id = String(videoId);
|
||||
mounted.forEach((card, i) => {
|
||||
if (card.dataset.videoId === id) unmount(i);
|
||||
});
|
||||
relayout();
|
||||
};
|
||||
|
||||
return { ensureInit, packFrom, update: scheduleUpdate, relayout, removeVideo, reset };
|
||||
})();
|
||||
|
||||
App.videos.updateLoadMoreState = function() {
|
||||
|
||||
Reference in New Issue
Block a user