feat: add Obsidian open button; fix folder button using dolphin --select
This commit is contained in:
+5
-1
@@ -8,6 +8,7 @@ const logoutBtn = document.getElementById('logout-btn');
|
||||
const modal = document.getElementById('modal');
|
||||
const modalTitle = document.getElementById('modal-title');
|
||||
const modalBody = document.getElementById('modal-body');
|
||||
const modalObsidianBtn = document.getElementById('modal-obsidian-btn');
|
||||
const modalFolderBtn = document.getElementById('modal-folder-btn');
|
||||
const modalOpenBtn = document.getElementById('modal-open-btn');
|
||||
const modalCloseBtn = document.getElementById('modal-close-btn');
|
||||
@@ -74,8 +75,11 @@ function closeModal() {
|
||||
modalCloseBtn.addEventListener('click', closeModal);
|
||||
modal.querySelector('.modal-backdrop').addEventListener('click', closeModal);
|
||||
document.addEventListener('keydown', e => { if (e.key === 'Escape') closeModal(); });
|
||||
modalObsidianBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, mode: 'obsidian' }) });
|
||||
});
|
||||
modalFolderBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, folder: true }) });
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath, mode: 'folder' }) });
|
||||
});
|
||||
modalOpenBtn.addEventListener('click', () => {
|
||||
if (_modalPath) apiFetch('/open', { method: 'POST', body: JSON.stringify({ path: _modalPath }) });
|
||||
|
||||
Reference in New Issue
Block a user