MCPcopy Create free account
hub / github.com/error311/FileRise / navigate

Function navigate

public/js/filePreview.js:722–733  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

720setNavVisibility(overlay, images.length > 1, images.length > 1);
721
722const navigate = (dir) => {
723 if (!overlay.mediaList || overlay.mediaList.length < 2) return;
724 overlay.mediaIndex = (overlay.mediaIndex + dir + overlay.mediaList.length) % overlay.mediaList.length;
725 const newFile = overlay.mediaList[overlay.mediaIndex].name;
726 currentName = newFile; // keep download button pointing to the right file
727 setTitle(overlay, newFile);
728 img.dataset.scale = 1;
729 img.dataset.rotate = 0;
730 img.style.transform = 'scale(1) rotate(0deg)';
731 setPreviewLoading(overlay, true, t('loading') || 'Loading...');
732 img.src = siblingPreviewUrl(newFile); // <-- changed
733};
734
735 if (images.length > 1) {
736 prevBtn.addEventListener('click', (e) => { e.stopPropagation(); navigate(-1); });

Callers 2

previewFileFunction · 0.85
onKeyFunction · 0.85

Calls 6

setTitleFunction · 0.85
setPreviewLoadingFunction · 0.85
tFunction · 0.85
siblingPreviewUrlFunction · 0.85
setVideoSrcFunction · 0.85
renderStatusFunction · 0.85

Tested by

no test coverage detected