overleaf/services/web/frontend/js/ide/toolbar/EditorLoaderController.js
Alf Eaton c8f0885316 Remove CM5 Rich Text module (#11776)
GitOrigin-RevId: 812d3b5f1df7e769c8be732ccb31653e8e9a8aa3
2023-08-16 08:03:35 +00:00

17 lines
452 B
JavaScript

import App from '../../base'
App.controller('EditorLoaderController', function ($scope, localStorage) {
$scope.$watch('editor.showVisual', function (val) {
localStorage(
`editor.mode.${$scope.project_id}`,
val === true ? 'rich-text' : 'source'
)
})
$scope.$watch('editor.newSourceEditor', function (val) {
localStorage(
`editor.source_editor.${$scope.project_id}`,
val === true ? 'cm6' : 'ace'
)
})
})