mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
wip
This commit is contained in:
parent
2af37640d8
commit
cb35284d37
@ -192,7 +192,10 @@ export default class TabManager extends Component {
|
|||||||
if (activate) {
|
if (activate) {
|
||||||
this.activateTab(tabContext.tabId, false);
|
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.$saveSearchButton.on('click', () => this.saveSearch());
|
||||||
|
|
||||||
this.$closeSearchButton.on('click', () => this.triggerCommand('hideSearch'));
|
this.$closeSearchButton.on('click', () => this.hideSearch());
|
||||||
|
|
||||||
return this.$widget;
|
return this.$widget;
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||||||
this.$searchInput.trigger('focus');
|
this.$searchInput.trigger('focus');
|
||||||
}
|
}
|
||||||
|
|
||||||
hideSearchEvent() {
|
hideSearch() {
|
||||||
this.resetSearchEvent();
|
this.resetSearchEvent();
|
||||||
|
|
||||||
this.$searchBox.slideUp();
|
this.$searchBox.slideUp();
|
||||||
@ -155,7 +155,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
|||||||
this.showSearchEvent();
|
this.showSearchEvent();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.hideSearchEvent();
|
this.hideSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,11 +79,13 @@ export default class TabAwareWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// when note is both switched and activated, this should not produce double refresh
|
// when note is both switched and activated, this should not produce double refresh
|
||||||
async tabNoteSwitchedAndActivatedEvent() {
|
async tabNoteSwitchedAndActivatedEvent({tabId, notePath}) {
|
||||||
|
if (this.isTab(tabId) && this.notePath === notePath) {
|
||||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||||
|
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async treeCacheReloadedEvent() {
|
async treeCacheReloadedEvent() {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
|
@ -575,7 +575,15 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
return closestIndex;
|
return closestIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tabNoteSwitchedAndActivatedEvent({tabId}) {
|
||||||
|
this.updateTabById(tabId);
|
||||||
|
}
|
||||||
|
|
||||||
tabNoteSwitchedEvent({tabId}) {
|
tabNoteSwitchedEvent({tabId}) {
|
||||||
|
this.updateTabById(tabId);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTabById(tabId) {
|
||||||
const $tab = this.getTabById(tabId);
|
const $tab = this.getTabById(tabId);
|
||||||
|
|
||||||
const {note} = appContext.tabManager.getTabContextById(tabId);
|
const {note} = appContext.tabManager.getTabContextById(tabId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user