Răsfoiți Sursa

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.
Brian Gough 9 ani în urmă
părinte
comite
dc6110db8d

+ 2 - 0
services/web/public/coffee/ide/editor/directives/aceEditor.coffee

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