mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 17:21:14 +00:00
Check if rich text is enabled before using stored mode
This commit is contained in:
parent
4202b9c717
commit
85313f1b5a
1 changed files with 7 additions and 2 deletions
|
@ -6,7 +6,7 @@ define [
|
||||||
"ide/editor/controllers/SavingNotificationController"
|
"ide/editor/controllers/SavingNotificationController"
|
||||||
], (Document) ->
|
], (Document) ->
|
||||||
class EditorManager
|
class EditorManager
|
||||||
constructor: (@ide, @$scope, localStorage) ->
|
constructor: (@ide, @$scope, @localStorage) ->
|
||||||
@$scope.editor = {
|
@$scope.editor = {
|
||||||
sharejs_doc: null
|
sharejs_doc: null
|
||||||
open_doc_id: null
|
open_doc_id: null
|
||||||
|
@ -14,7 +14,7 @@ define [
|
||||||
opening: true
|
opening: true
|
||||||
trackChanges: false
|
trackChanges: false
|
||||||
wantTrackChanges: false
|
wantTrackChanges: false
|
||||||
showRichText: localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
|
showRichText: @showRichText()
|
||||||
}
|
}
|
||||||
|
|
||||||
@$scope.$on "entity:selected", (event, entity) =>
|
@$scope.$on "entity:selected", (event, entity) =>
|
||||||
|
@ -41,6 +41,11 @@ define [
|
||||||
return if !value?
|
return if !value?
|
||||||
@_syncTrackChangesState(@$scope.editor.sharejs_doc)
|
@_syncTrackChangesState(@$scope.editor.sharejs_doc)
|
||||||
|
|
||||||
|
showRichText: () ->
|
||||||
|
if !window.richTextEnabled
|
||||||
|
return false
|
||||||
|
@localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
|
||||||
|
|
||||||
autoOpenDoc: () ->
|
autoOpenDoc: () ->
|
||||||
open_doc_id =
|
open_doc_id =
|
||||||
@ide.localStorage("doc.open_id.#{@$scope.project_id}") or
|
@ide.localStorage("doc.open_id.#{@$scope.project_id}") or
|
||||||
|
|
Loading…
Reference in a new issue