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

Merge pull request #588 from zblesk/search-display-notebook

Displaying the notebook's name in the Note toolbar when search is act…
This commit is contained in:
Laurent Cozic 2018-06-10 11:50:08 +01:00 committed by GitHub
commit d4ec8ae823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,6 +224,7 @@ class NoteTextComponent extends React.Component {
let noteId = null;
let note = null;
let loadingNewNote = true;
let parentFolder = null;
if (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 = {
note: note,
lastSavedNote: Object.assign({}, note),
webviewReady: webviewReady,
folder: parentFolder,
};
if (!note) {
@ -828,6 +835,15 @@ class NoteTextComponent extends React.Component {
}
const toolbarItems = [];
if (note
&& this.state.folder !== null
&& ['Search', 'Tag'].includes(this.props.notesParentType)) {
toolbarItems.push({
title: _("In") + ": " + this.state.folder.title,
iconName: 'fa-folder-o',
enabled: false,
});
}
toolbarItems.push({
title: _('Attach file'),