1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Desktop: Allow creating new note when multiple notes are selected

This commit is contained in:
Laurent Cozic 2019-02-13 22:57:43 +00:00
parent 4e0f4397b2
commit a3e74320fa
2 changed files with 11 additions and 5 deletions

View File

@ -481,11 +481,13 @@ class NoteTextComponent extends React.Component {
if (this.props.newNote) {
const focusSettingName = !!note.is_todo ? 'newTodoFocus' : 'newNoteFocus';
if (Setting.value(focusSettingName) === 'title') {
if (this.titleField_) this.titleField_.focus();
} else {
if (this.editor_) this.editor_.editor.focus();
}
requestAnimationFrame(() => {
if (Setting.value(focusSettingName) === 'title') {
if (this.titleField_) this.titleField_.focus();
} else {
if (this.editor_) this.editor_.editor.focus();
}
});
}
if (this.editor_) {

View File

@ -639,6 +639,10 @@ const reducer = (state = defaultState, action) => {
newState = Object.assign({}, state);
newState.newNote = action.item;
if (newState.selectedNoteIds.length > 1) {
newState.selectedNoteIds = newState.selectedNoteIds.slice();
newState.selectedNoteIds = [newState.selectedNoteIds[0]];
}
break;
case 'CLIPPER_SERVER_SET':