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

Displaying the notebook's name in the Note toolbar when search is active.

This commit is contained in:
zblesk 2018-06-05 10:27:07 +02:00
parent eb43ddc701
commit c7f61271a0

View File

@ -224,6 +224,7 @@ class NoteTextComponent extends React.Component {
let noteId = null; let noteId = null;
let note = null; let note = null;
let loadingNewNote = true; let loadingNewNote = true;
let parentFolder = null;
if (props.newNote) { if (props.newNote) {
note = Object.assign({}, props.newNote); note = Object.assign({}, props.newNote);
@ -296,10 +297,16 @@ class NoteTextComponent extends React.Component {
} }
} }
if (note)
{
parentFolder = Folder.byId(props.folders, note.parent_id);
}
let newState = { let newState = {
note: note, note: note,
lastSavedNote: Object.assign({}, note), lastSavedNote: Object.assign({}, note),
webviewReady: webviewReady, webviewReady: webviewReady,
folder: parentFolder,
}; };
if (!note) { if (!note) {
@ -829,6 +836,15 @@ class NoteTextComponent extends React.Component {
const toolbarItems = []; const toolbarItems = [];
if (note
&& this.state.folder !== null
&& this.props.notesParentType == 'Search') {
toolbarItems.push({
title: _(this.state.folder.title),
iconName: 'fa-folder-o',
});
}
toolbarItems.push({ toolbarItems.push({
title: _('Attach file'), title: _('Attach file'),
iconName: 'fa-paperclip', iconName: 'fa-paperclip',