show item path on Recent + Favorites, add go to parent folder, fix Folder browsing in Favorites
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { resolveHomeFolder } from '../../app/authSession.js';
|
||||
import { loadFiles } from '../../app/filesView.js';
|
||||
import { switchToFilesSection } from '../../app/navigation.js';
|
||||
import { app } from '../../app/state.js';
|
||||
import { showConfirmDialog, ui } from '../../app/ui.js';
|
||||
import { getCsrfHeaders } from '../../core/csrf.js';
|
||||
@@ -64,6 +65,13 @@ const contextMenus = {
|
||||
}
|
||||
},
|
||||
|
||||
syncOpenParentFolderOption() {
|
||||
const option = document.getElementById('open-parent-folder-option');
|
||||
if (!option) return;
|
||||
const folderId = app?.contextMenuTargetFile?.folder_id;
|
||||
option.classList.toggle('hidden', !folderId);
|
||||
},
|
||||
|
||||
syncAddToPlaylistOption() {
|
||||
const option = document.getElementById('add-to-playlist-option');
|
||||
if (!option) return;
|
||||
@@ -198,6 +206,16 @@ const contextMenus = {
|
||||
ui.closeFileContextMenu();
|
||||
});
|
||||
|
||||
document.getElementById('open-parent-folder-option').addEventListener('click', () => {
|
||||
const folderId = app.contextMenuTargetFile?.folder_id;
|
||||
ui.closeFileContextMenu();
|
||||
if (folderId) {
|
||||
switchToFilesSection();
|
||||
app.currentPath = folderId;
|
||||
loadFiles();
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('favorite-file-option').addEventListener('click', async () => {
|
||||
if (app.contextMenuTargetFile) {
|
||||
const file = app.contextMenuTargetFile;
|
||||
|
||||
Reference in New Issue
Block a user