mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Add handleNoteDelete
This commit is contained in:
@@ -364,8 +364,6 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleNoteContextMenu (e, uniqueKey) {
|
handleNoteContextMenu (e, uniqueKey) {
|
||||||
this.handleNoteClick(e, uniqueKey)
|
|
||||||
|
|
||||||
const { location } = this.props
|
const { location } = this.props
|
||||||
let targetIndex = _.findIndex(this.notes, (note) => {
|
let targetIndex = _.findIndex(this.notes, (note) => {
|
||||||
return note != null && uniqueKey === `${note.storage}-${note.key}`
|
return note != null && uniqueKey === `${note.storage}-${note.key}`
|
||||||
@@ -382,7 +380,7 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
menu.append(new MenuItem({
|
menu.append(new MenuItem({
|
||||||
label: 'Delete Note',
|
label: 'Delete Note',
|
||||||
click: () => ee.emit('detail:delete')
|
click: (e) => this.handleDeleteNote(e, uniqueKey)
|
||||||
}))
|
}))
|
||||||
menu.popup()
|
menu.popup()
|
||||||
}
|
}
|
||||||
@@ -428,6 +426,11 @@ class NoteList extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleDeleteNote (e, uniqueKey) {
|
||||||
|
this.handleNoteClick(e, uniqueKey)
|
||||||
|
ee.emit('detail:delete')
|
||||||
|
}
|
||||||
|
|
||||||
importFromFile () {
|
importFromFile () {
|
||||||
const { dispatch, location } = this.props
|
const { dispatch, location } = this.props
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user