From dc60be404aeedf18aec932803a09791e47e83248 Mon Sep 17 00:00:00 2001 From: yosmoc Date: Mon, 30 Apr 2018 22:30:41 +0200 Subject: [PATCH 1/2] select next note after tranfer note(s) to another folder --- browser/main/NoteList/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index e8c09f65..07e98670 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -460,7 +460,7 @@ class NoteList extends React.Component { const selectedNotes = findNotesByKeys(notes, selectedNoteKeys) const noteData = JSON.stringify(selectedNotes) e.dataTransfer.setData('note', noteData) - this.setState({ selectedNoteKeys: [] }) + this.selectNextNote() } handleNoteContextMenu (e, uniqueKey) { From 2d0f7589eaa1c6ecc47624fcb67ac30a6589c887 Mon Sep 17 00:00:00 2001 From: yosmoc Date: Mon, 30 Apr 2018 22:34:15 +0200 Subject: [PATCH 2/2] select proper notes for dragging When the dragged target note is included in the selected notes, keeps the current selected notes, otherwise, replace the selected notes by the dragged target --- browser/main/NoteList/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 07e98670..876de0c0 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -455,7 +455,14 @@ class NoteList extends React.Component { } handleDragStart (e, note) { - const { selectedNoteKeys } = this.state + let { selectedNoteKeys } = this.state + const noteKey = getNoteKey(note) + + if (!selectedNoteKeys.includes(noteKey)) { + selectedNoteKeys = [] + selectedNoteKeys.push(noteKey) + } + const notes = this.notes.map((note) => Object.assign({}, note)) const selectedNotes = findNotesByKeys(notes, selectedNoteKeys) const noteData = JSON.stringify(selectedNotes)