Merge pull request #7795 from overleaf/ae-history-view

Avoid switching away from v1 history view when a file is selected

GitOrigin-RevId: 7b7d75f5e4c63bf899fc7f1f5c7c17119863177b
This commit is contained in:
Alf Eaton 2022-05-09 12:03:50 +01:00 committed by Copybot
parent fcdd02fac1
commit 3a81428ef3
2 changed files with 16 additions and 3 deletions

View file

@ -1,6 +1,15 @@
.diff-panel.full-size(ng-if="!history.isV2", ng-controller="HistoryDiffController")
div(
ng-controller="FileViewController"
ng-if="ui.view == 'history' && openFile"
)
file-view(
file="file"
store-references-keys="storeReferencesKeys"
)
.diff(
ng-if="!!history.diff && !history.diff.loading && !history.diff.deleted && !history.diff.error && !history.diff.binary"
ng-if="!!history.diff && !history.diff.loading && !history.diff.deleted && !history.diff.error && !openFile"
)
.toolbar.toolbar-alt
span.name

View file

@ -26,7 +26,9 @@ export default BinaryFilesManager = class BinaryFilesManager {
openFile(file) {
this.ide.fileTreeManager.selectEntity(file)
this.$scope.ui.view = 'file'
if (this.$scope.ui.view !== 'history') {
this.$scope.ui.view = 'file'
}
this.$scope.openFile = null
this.$scope.$apply()
return window.setTimeout(
@ -46,7 +48,9 @@ export default BinaryFilesManager = class BinaryFilesManager {
return window.setTimeout(
() => {
this.$scope.openFile = null
this.$scope.ui.view = 'editor'
if (this.$scope.ui.view !== 'history') {
this.$scope.ui.view = 'editor'
}
this.$scope.$apply()
},
0,