From cd5be594135d888a26e0613d47373b38f3f32045 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 7 Feb 2021 20:55:49 +0100 Subject: [PATCH] tab row is detecting workspace changes --- src/public/app/services/load_results.js | 1 + src/public/app/widgets/note_tree.js | 6 ++++-- src/public/app/widgets/quick_search.js | 4 ++-- src/public/app/widgets/tab_row.js | 10 +++++++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/public/app/services/load_results.js b/src/public/app/services/load_results.js index 359dbc31c..a75cae9ff 100644 --- a/src/public/app/services/load_results.js +++ b/src/public/app/services/load_results.js @@ -54,6 +54,7 @@ export default class LoadResults { this.attributes.push({attributeId, sourceId}); } + /** @return {Attribute[]} */ getAttributes(sourceId = 'none') { return this.attributes .filter(row => row.sourceId !== sourceId) diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index e10d23397..0f534487f 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -515,7 +515,9 @@ export default class NoteTreeWidget extends TabAwareWidget { $span.find('.tree-item-button').remove(); - if (activeTabContext && activeTabContext.hoistedNoteId === note.noteId && note.noteId !== 'root') { + const isHoistedNote = activeTabContext && activeTabContext.hoistedNoteId === note.noteId && note.noteId !== 'root'; + + if (isHoistedNote) { const $unhoistButton = $(''); $unhoistButton.on('click', () => alert("bebe")); @@ -523,7 +525,7 @@ export default class NoteTreeWidget extends TabAwareWidget { $span.append($unhoistButton); } - if (note.hasLabel('workspace')) { + if (note.hasLabel('workspace') && !isHoistedNote) { const $enterWorkspaceButton = $(''); $span.append($enterWorkspaceButton); diff --git a/src/public/app/widgets/quick_search.js b/src/public/app/widgets/quick_search.js index 8860c3ba5..48740293f 100644 --- a/src/public/app/widgets/quick_search.js +++ b/src/public/app/widgets/quick_search.js @@ -10,8 +10,8 @@ const TPL = `