mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Check if rich text is enabled before using stored mode
This commit is contained in:
@@ -6,7 +6,7 @@ define [
|
||||
"ide/editor/controllers/SavingNotificationController"
|
||||
], (Document) ->
|
||||
class EditorManager
|
||||
constructor: (@ide, @$scope, localStorage) ->
|
||||
constructor: (@ide, @$scope, @localStorage) ->
|
||||
@$scope.editor = {
|
||||
sharejs_doc: null
|
||||
open_doc_id: null
|
||||
@@ -14,7 +14,7 @@ define [
|
||||
opening: true
|
||||
trackChanges: false
|
||||
wantTrackChanges: false
|
||||
showRichText: localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
|
||||
showRichText: @showRichText()
|
||||
}
|
||||
|
||||
@$scope.$on "entity:selected", (event, entity) =>
|
||||
@@ -41,6 +41,11 @@ define [
|
||||
return if !value?
|
||||
@_syncTrackChangesState(@$scope.editor.sharejs_doc)
|
||||
|
||||
showRichText: () ->
|
||||
if !window.richTextEnabled
|
||||
return false
|
||||
@localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
|
||||
|
||||
autoOpenDoc: () ->
|
||||
open_doc_id =
|
||||
@ide.localStorage("doc.open_id.#{@$scope.project_id}") or
|
||||
|
||||
Reference in New Issue
Block a user