Merge pull request #6592 from overleaf/jk-cm6-switch-focus

[web] CM6: focus editor when switching back to doc

GitOrigin-RevId: 1ef63dbcbd3befc2a2a7c4b43dc3a357489e5a11
This commit is contained in:
June Kelly 2022-02-03 09:38:07 +00:00 committed by Copybot
parent 4b14a14819
commit e92cc8a4b1

View file

@ -178,7 +178,9 @@ export default EditorManager = (function () {
this.$scope.ui.view = 'editor'
const done = isNewDoc => {
this.$scope.$broadcast('doc:after-opened', { isNewDoc })
const eventName = 'doc:after-opened'
this.$scope.$broadcast(eventName, { isNewDoc })
window.dispatchEvent(new CustomEvent(eventName, { isNewDoc }))
if (options.gotoLine != null) {
// allow Ace to display document before moving, delay until next tick
// added delay to make this happen later that gotoStoredPosition in