mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-17 19:51:42 +00:00
Clean up trash context menu
This commit is contained in:
@@ -481,50 +481,53 @@ class NoteList extends React.Component {
|
|||||||
const openBlogLabel = i18n.__('Open Blog')
|
const openBlogLabel = i18n.__('Open Blog')
|
||||||
|
|
||||||
const menu = new Menu()
|
const menu = new Menu()
|
||||||
if (!location.pathname.match(/\/starred|\/trash/)) {
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: pinLabel,
|
|
||||||
click: this.pinToTop
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (location.pathname.match(/\/trash/)) {
|
if (location.pathname.match(/\/trash/)) {
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: restoreNote,
|
label: restoreNote,
|
||||||
click: this.restoreNote
|
click: this.restoreNote
|
||||||
}))
|
}))
|
||||||
}
|
menu.append(new MenuItem({
|
||||||
|
label: deleteLabel,
|
||||||
menu.append(new MenuItem({
|
click: this.deleteNote
|
||||||
label: deleteLabel,
|
}))
|
||||||
click: this.deleteNote
|
} else {
|
||||||
}))
|
if (!location.pathname.match(/\/starred/)) {
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: cloneNote,
|
|
||||||
click: this.cloneNote.bind(this)
|
|
||||||
}))
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: copyNoteLink,
|
|
||||||
click: this.copyNoteLink(note)
|
|
||||||
}))
|
|
||||||
if (note.type === 'MARKDOWN_NOTE') {
|
|
||||||
if (note.blog && note.blog.blogLink && note.blog.blogId) {
|
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: updateLabel,
|
label: pinLabel,
|
||||||
click: this.publishMarkdown.bind(this)
|
click: this.pinToTop
|
||||||
}))
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: openBlogLabel,
|
|
||||||
click: () => this.openBlog.bind(this)(note)
|
|
||||||
}))
|
|
||||||
} else {
|
|
||||||
menu.append(new MenuItem({
|
|
||||||
label: publishLabel,
|
|
||||||
click: this.publishMarkdown.bind(this)
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: deleteLabel,
|
||||||
|
click: this.deleteNote
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: cloneNote,
|
||||||
|
click: this.cloneNote.bind(this)
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: copyNoteLink,
|
||||||
|
click: this.copyNoteLink(note)
|
||||||
|
}))
|
||||||
|
if (note.type === 'MARKDOWN_NOTE') {
|
||||||
|
if (note.blog && note.blog.blogLink && note.blog.blogId) {
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: updateLabel,
|
||||||
|
click: this.publishMarkdown.bind(this)
|
||||||
|
}))
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: openBlogLabel,
|
||||||
|
click: () => this.openBlog.bind(this)(note)
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
menu.append(new MenuItem({
|
||||||
|
label: publishLabel,
|
||||||
|
click: this.publishMarkdown.bind(this)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.popup()
|
menu.popup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user