mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fixes
This commit is contained in:
parent
49398f5374
commit
8888d04878
6
libraries/autocomplete.jquery.min.js
vendored
6
libraries/autocomplete.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -49,8 +49,6 @@ class TabContext extends Component {
|
||||
|
||||
this.autoBookDisabled = false;
|
||||
|
||||
//this.cleanup(); // esp. on windows autocomplete is not getting closed automatically
|
||||
|
||||
setTimeout(async () => {
|
||||
// we include the note into recent list only if the user stayed on the note at least 5 seconds
|
||||
if (notePath && notePath === this.notePath) {
|
||||
|
@ -222,7 +222,7 @@ export default class TabManager extends Component {
|
||||
this.activeTabId = tabId;
|
||||
|
||||
if (triggerEvent) {
|
||||
this.triggerEvent('activeTabChanged');
|
||||
this.triggerEvent('activeTabChanged', {tabId});
|
||||
}
|
||||
|
||||
this.tabsUpdate.scheduleUpdate();
|
||||
|
@ -117,7 +117,12 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
||||
|
||||
this.$widget.append($renderedWidget);
|
||||
|
||||
typeWidget.handleEvent('setTabContext', {tabContext: this.tabContext});
|
||||
await typeWidget.handleEvent('setTabContext', {tabContext: this.tabContext});
|
||||
|
||||
typeWidget.handleEvent('tabNoteSwitched', {
|
||||
tabId: this.tabContext.tabId,
|
||||
notePath: this.notePath
|
||||
});
|
||||
}
|
||||
|
||||
this.setupClasses();
|
||||
|
@ -72,17 +72,21 @@ export default class TabAwareWidget extends BasicWidget {
|
||||
|
||||
async refreshWithNote(note, notePath) {}
|
||||
|
||||
async activeTabChangedEvent() {
|
||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||
async activeTabChangedEvent({tabId}) {
|
||||
this.tabContext = appContext.tabManager.getTabContextById(tabId);
|
||||
|
||||
if (this.tabContext.tabId === appContext.tabManager.getActiveTabContext().tabId) {
|
||||
await this.activeTabChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// when note is both switched and activated, this should not produce double refresh
|
||||
async tabNoteSwitchedAndActivatedEvent({tabId, notePath}) {
|
||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||
this.tabContext = appContext.tabManager.getTabContextById(tabId);
|
||||
|
||||
if (this.tabContext.tabId === appContext.tabManager.getActiveTabContext().tabId
|
||||
&& this.notePath === notePath) {
|
||||
|
||||
if (this.notePath === notePath) {
|
||||
this.tabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
await this.refresh();
|
||||
|
@ -1,5 +1,6 @@
|
||||
import TabAwareWidget from "./tab_aware_widget.js";
|
||||
import keyboardActionsService from "../services/keyboard_actions.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
|
||||
export default class TabCachingWidget extends TabAwareWidget {
|
||||
constructor(widgetFactory) {
|
||||
@ -42,7 +43,9 @@ export default class TabCachingWidget extends TabAwareWidget {
|
||||
|
||||
keyboardActionsService.updateDisplayedShortcuts($renderedWidget);
|
||||
|
||||
await this.widgets[tabId].handleEvent('setTabContext', {tabContext: this.tabContext});
|
||||
await this.widgets[tabId].handleEvent('setTabContext', {
|
||||
tabContext: appContext.tabManager.getTabContextById(tabId)
|
||||
});
|
||||
|
||||
this.child(this.widgets[tabId]); // add as child only once it is ready (rendered with tabContext)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user