overleaf/services/web/frontend/js/ide/toolbar/EditorLoaderController.js
Jakob Ackermann e959529828 Merge pull request #15129 from overleaf/mj-jpa-angular-parameters
[web] Explicitly name angular parameters

GitOrigin-RevId: 91beae68989d6c8122132b531a4338b116d87424
2023-10-16 08:04:25 +00:00

21 lines
515 B
JavaScript

import App from '../../base'
App.controller('EditorLoaderController', [
'$scope',
'localStorage',
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'
)
})
},
])