mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
put ace in readonly mode when changing session
if the session fails to attach successfully (e.g due to an exception in the changeSession event handler) the editor will be left in a state where the user will not be able to enter any text. This should at least cause them to reload the editor.
This commit is contained in:
parent
f001c6745e
commit
dc6110db8d
1 changed files with 2 additions and 0 deletions
|
@ -356,6 +356,7 @@ define [
|
|||
session.setOption("useWorker", scope.syntaxValidation);
|
||||
|
||||
# now attach session to editor
|
||||
editor.setReadOnly(true)
|
||||
editor.setSession(session)
|
||||
|
||||
doc = session.getDocument()
|
||||
|
@ -364,6 +365,7 @@ define [
|
|||
editor.initing = true
|
||||
sharejs_doc.attachToAce(editor)
|
||||
editor.initing = false
|
||||
editor.setReadOnly(false)
|
||||
|
||||
resetScrollMargins()
|
||||
|
||||
|
|
Loading…
Reference in a new issue