overleaf/services/web/frontend/js/ide/toolbar/EditorLoaderController.js
Domagoj Kriskovic da2f7ff153 Store editor selection on a per-user rather than per-project basis (#16246)
* Store editor selection on a per-user rather than per-project basis

* set code editor if rich_text=false

* format fix

GitOrigin-RevId: 8efc33b682de211162e674839e6b891ec04e542e
2023-12-19 09:04:31 +00:00

11 lines
286 B
JavaScript

import App from '../../base'
App.controller('EditorLoaderController', [
'$scope',
'localStorage',
function ($scope, localStorage) {
$scope.$watch('editor.showVisual', function (val) {
localStorage(`editor.lastUsedMode`, val === true ? 'visual' : 'code')
})
},
])