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:
Brian Gough 2017-11-16 11:32:08 +00:00
parent f001c6745e
commit dc6110db8d

View file

@ -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()