Merge pull request #10794 from overleaf/td-resize-while-loading

Ensure editor is the correct size after window resize during load

GitOrigin-RevId: 0677ef6aa5d1dd7b6aea9158343b8ccbb3a6562b
This commit is contained in:
Tim Down 2022-12-06 14:51:59 +00:00 committed by Copybot
parent fa67c3fcff
commit fde8ab422b
2 changed files with 7 additions and 0 deletions

View file

@ -17,6 +17,7 @@ class LoadingManager {
this.$scope.$apply(() => {
this.$scope.state.load_progress = 100
this.$scope.state.loading = false
this.$scope.$emit('editor:loaded')
})
})
// Note: this will only catch errors in from i18n setup. ConnectionManager

View file

@ -236,6 +236,12 @@ ng-click=\"handleClick()\">\
.$applyAsync(() => (customTogglerEl.scope().isOpen = false))
}
// Ensure editor resizes after loading. This is to handle the case where
// the window has been resized while the editor is loading
scope.$on('editor:loaded', () => {
ide.$timeout(() => layout.resizeAll())
})
// Save state when exiting
$(window).unload(() => {
// Save only the state properties for the current layout, ignoring sublayouts inside it.