mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 20:21:43 +08:00
wip
This commit is contained in:
parent
2af37640d8
commit
cb35284d37
4 changed files with 20 additions and 7 deletions
|
@ -192,7 +192,10 @@ export default class TabManager extends Component {
|
|||
if (activate) {
|
||||
this.activateTab(tabContext.tabId, false);
|
||||
|
||||
this.triggerEvent('tabNoteSwitchedAndActivated');
|
||||
this.triggerEvent('tabNoteSwitchedAndActivated', {
|
||||
tabId: tabContext.tabId,
|
||||
notePath
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||
|
||||
this.$saveSearchButton.on('click', () => this.saveSearch());
|
||||
|
||||
this.$closeSearchButton.on('click', () => this.triggerCommand('hideSearch'));
|
||||
this.$closeSearchButton.on('click', () => this.hideSearch());
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||
this.$searchInput.trigger('focus');
|
||||
}
|
||||
|
||||
hideSearchEvent() {
|
||||
hideSearch() {
|
||||
this.resetSearchEvent();
|
||||
|
||||
this.$searchBox.slideUp();
|
||||
|
@ -155,7 +155,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||
this.showSearchEvent();
|
||||
}
|
||||
else {
|
||||
this.hideSearchEvent();
|
||||
this.hideSearch();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,10 +79,12 @@ export default class TabAwareWidget extends BasicWidget {
|
|||
}
|
||||
|
||||
// when note is both switched and activated, this should not produce double refresh
|
||||
async tabNoteSwitchedAndActivatedEvent() {
|
||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||
async tabNoteSwitchedAndActivatedEvent({tabId, notePath}) {
|
||||
if (this.isTab(tabId) && this.notePath === notePath) {
|
||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
await this.refresh();
|
||||
await this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
async treeCacheReloadedEvent() {
|
||||
|
|
|
@ -575,7 +575,15 @@ export default class TabRowWidget extends BasicWidget {
|
|||
return closestIndex;
|
||||
};
|
||||
|
||||
tabNoteSwitchedAndActivatedEvent({tabId}) {
|
||||
this.updateTabById(tabId);
|
||||
}
|
||||
|
||||
tabNoteSwitchedEvent({tabId}) {
|
||||
this.updateTabById(tabId);
|
||||
}
|
||||
|
||||
updateTabById(tabId) {
|
||||
const $tab = this.getTabById(tabId);
|
||||
|
||||
const {note} = appContext.tabManager.getTabContextById(tabId);
|
||||
|
|
Loading…
Reference in a new issue