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