mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 05:42:35 +00:00
Merge pull request #113 from sharelatex/bg-prevent-editing-in-broken-ace-session
put ace in readonly mode when changing session
This commit is contained in:
commit
dc71a6a0a1
1 changed files with 3 additions and 0 deletions
|
@ -356,6 +356,7 @@ define [
|
|||
session.setOption("useWorker", scope.syntaxValidation);
|
||||
|
||||
# now attach session to editor
|
||||
editor.setReadOnly(true) # set to readonly until document change handlers are attached
|
||||
editor.setSession(session)
|
||||
|
||||
doc = session.getDocument()
|
||||
|
@ -364,6 +365,8 @@ define [
|
|||
editor.initing = true
|
||||
sharejs_doc.attachToAce(editor)
|
||||
editor.initing = false
|
||||
# now ready to edit document
|
||||
editor.setReadOnly(scope.readOnly) # respect the readOnly setting, normally false
|
||||
|
||||
resetScrollMargins()
|
||||
|
||||
|
|
Loading…
Reference in a new issue