mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #8804 from overleaf/jel-rich-text-pos
[web] Fix stored rich text position GitOrigin-RevId: 7ef916919220d63d88f66ee261f91a5af08dcefb
This commit is contained in:
@@ -25,6 +25,11 @@ export default BinaryFilesManager = class BinaryFilesManager {
|
||||
}
|
||||
|
||||
openFile(file) {
|
||||
if (this.$scope.ui.view === 'editor') {
|
||||
// store position before switching to binary view
|
||||
this.$scope.$broadcast('store-doc-position')
|
||||
}
|
||||
|
||||
this.ide.fileTreeManager.selectEntity(file)
|
||||
if (this.$scope.ui.view !== 'history') {
|
||||
this.$scope.ui.view = 'file'
|
||||
|
||||
@@ -201,6 +201,10 @@ export default EditorManager = (function () {
|
||||
options = {}
|
||||
}
|
||||
sl_console.log(`[openDoc] Opening ${doc.id}`)
|
||||
if (this.$scope.ui.view === 'editor') {
|
||||
// store position of previous doc before switching docs
|
||||
this.$scope.$broadcast('store-doc-position')
|
||||
}
|
||||
this.$scope.ui.view = 'editor'
|
||||
|
||||
const done = isNewDoc => {
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ export default CursorPositionManager = class CursorPositionManager {
|
||||
this.localStorage = localStorage
|
||||
this.$scope.$on('editorInit', this.jumpToPositionInNewDoc)
|
||||
|
||||
this.$scope.$on('beforeChangeDocument', this.storePositionAndLine)
|
||||
this.$scope.$on('store-doc-position', this.storePositionAndLine)
|
||||
|
||||
this.$scope.$on('afterChangeDocument', this.jumpToPositionInNewDoc)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user