This commit is contained in:
@@ -38,6 +38,14 @@ onMounted(() => {
|
||||
border: 1px solid var(--color-border);
|
||||
overflow: visible;
|
||||
|
||||
.context-menu-divider {
|
||||
height: 1px;
|
||||
margin: 4px 0;
|
||||
border-top: 1px solid var(--color-border);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.context-menu-element {
|
||||
&:last-child {
|
||||
border-width: 1px 1px 1px 1px;
|
||||
|
||||
@@ -153,6 +153,7 @@ function buildNoteContextMenu(note) {
|
||||
}
|
||||
|
||||
function buildFolderContextMenu(folder) {
|
||||
if (!folder || !folder._id) return [];
|
||||
return [
|
||||
{ name: 'New Note Here', icon: '/icons/iconoir/regular/plus.svg', action: () => createNoteInFolder(folder._id) },
|
||||
{ name: 'Rename', icon: '/icons/iconoir/regular/edit-pencil.svg', action: () => renameFolder(folder._id, folder.name) },
|
||||
@@ -180,8 +181,9 @@ async function deleteNote(note) {
|
||||
try {
|
||||
const response = await Server().post('/note/delete', { id: note.key });
|
||||
if (response.data.status === 'ok') { emit('reload-notes'); emitter.emit('delete-note', note.key); }
|
||||
} catch (error) {}
|
||||
} catch (error) {} finally {
|
||||
HideContextMenu();
|
||||
}
|
||||
}
|
||||
|
||||
function renameFolder(folderId, name) { CreateWindow('new_folder', { folderId, campaign: props.campaignId, name }); }
|
||||
|
||||
@@ -27,6 +27,14 @@ function PopulateContext(val){
|
||||
|
||||
let elementNum = 0;
|
||||
val.forEach(element => {
|
||||
// Handle divider elements
|
||||
if (element.divider) {
|
||||
let contextMenuElement = document.createElement('div');
|
||||
contextMenuElement.classList.add("context-menu-divider");
|
||||
children.push(contextMenuElement);
|
||||
return;
|
||||
}
|
||||
|
||||
let contextMenuElement = document.createElement('div');
|
||||
contextMenuElement.classList.add("context-menu-element");
|
||||
if(element.action)
|
||||
|
||||
Reference in New Issue
Block a user