diff --git a/browser/components/NoteItem.js b/browser/components/NoteItem.js index 1652b02b..9f49fb28 100644 --- a/browser/components/NoteItem.js +++ b/browser/components/NoteItem.js @@ -41,16 +41,18 @@ const TagElementList = (tags) => { * @param {boolean} isActive * @param {Object} note * @param {Function} handleNoteClick + * @param {Function} handleNoteContextMenu * @param {Function} handleDragStart * @param {string} dateDisplay */ -const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleDragStart }) => ( +const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart }) => (
handleNoteClick(e, `${note.storage}-${note.key}`)} + onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)} onDragStart={e => handleDragStart(e, note)} draggable='true' > diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index c1441322..682c755d 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -338,6 +338,17 @@ class NoteList extends React.Component { e.dataTransfer.setData('note', noteData) } + handleNoteContextMenu (e, uniqueKey) { + this.handleNoteClick(e, uniqueKey) + + let menu = new Menu() + menu.append(new MenuItem({ + label: 'Delete Note', + click: () => ee.emit('detail:delete') + })) + menu.popup() + } + importFromFile () { const { dispatch, location } = this.props @@ -432,6 +443,7 @@ class NoteList extends React.Component { note={note} dateDisplay={dateDisplay} key={key} + handleNoteContextMenu={this.handleNoteContextMenu.bind(this)} handleNoteClick={this.handleNoteClick.bind(this)} handleDragStart={this.handleDragStart.bind(this)} />