fix: reload layout when double clicking on panel resizer

This commit is contained in:
Antonella Sgarlatta
2021-06-02 18:38:54 -03:00
parent de31fe7d61
commit 595b44dfee
3 changed files with 14 additions and 10 deletions

View File

@@ -169,6 +169,6 @@
default-width="300"
hoverable="true"
on-resize-finish="self.onPanelResize"
on-mouse-move-event="self.onPanelMouseMoveEvent"
on-width-event="self.onPanelWidthEvent"
panel-id="'notes-column'"
)

View File

@@ -93,7 +93,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
};
this.onWindowResize = this.onWindowResize.bind(this);
this.onPanelResize = this.onPanelResize.bind(this);
this.onPanelMouseMoveEvent = this.onPanelMouseMoveEvent.bind(this);
this.onPanelWidthEvent = this.onPanelWidthEvent.bind(this);
window.addEventListener('resize', this.onWindowResize, true);
this.registerKeyboardShortcuts();
this.autorun(async () => {
@@ -134,7 +134,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
window.removeEventListener('resize', this.onWindowResize, true);
(this.onWindowResize as any) = undefined;
(this.onPanelResize as any) = undefined;
(this.onPanelMouseMoveEvent as any) = undefined;
(this.onPanelWidthEvent as any) = undefined;
this.newNoteKeyObserver();
this.nextNoteKeyObserver();
this.previousNoteKeyObserver();
@@ -649,6 +649,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
__: boolean,
isCollapsed: boolean
) {
this.appState.activeNote.reloadTagsContainerMaxWidth();
this.application.setPreference(
PrefKey.NotesPanelWidth,
newWidth
@@ -659,7 +660,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
);
}
onPanelMouseMoveEvent(): void {
onPanelWidthEvent(): void {
this.appState.activeNote.reloadTagsContainerMaxWidth();
}