Merge pull request #7075 from overleaf/ta-mutli-selection-ui-fix

Bring Multi-Selection UI Back

GitOrigin-RevId: a0e086da98bb1de88cb2e96ddc2acfd5240a01a7
This commit is contained in:
ilkin-overleaf 2022-03-21 16:47:26 +02:00 committed by Copybot
parent ebec861562
commit ea729ca2af
4 changed files with 12 additions and 9 deletions

View file

@ -13,10 +13,16 @@
}" }"
) )
.multi-selection-ongoing(
ng-show="editor.multiSelectedCount > 0"
)
.multi-selection-message
h4 {{ editor.multiSelectedCount }} #{translate('files_selected')}
include ./file-view include ./file-view
.editor-container.full-size( .editor-container.full-size(
ng-show="ui.view == 'editor'" ng-show="ui.view == 'editor' && editor.multiSelectedCount === 0"
vertical-resizable-panes="symbol-palette-resizer" vertical-resizable-panes="symbol-palette-resizer"
vertical-resizable-panes-hidden-externally-on="symbol-palette-toggled" vertical-resizable-panes-hidden-externally-on="symbol-palette-toggled"
vertical-resizable-panes-hidden-initially="true" vertical-resizable-panes-hidden-initially="true"
@ -43,12 +49,6 @@
else else
.toolbar.toolbar-editor .toolbar.toolbar-editor
.multi-selection-ongoing(
ng-show="multiSelectedCount > 0"
)
.multi-selection-message
h4 {{ multiSelectedCount }} #{translate('files_selected')}
div(ng-if="editor.newSourceEditor") div(ng-if="editor.newSourceEditor")
if moduleIncludesAvailable('editor:source-editor') if moduleIncludesAvailable('editor:source-editor')
!= moduleIncludes('editor:source-editor', locals) != moduleIncludes('editor:source-editor', locals)

View file

@ -1,7 +1,7 @@
div( div(
ng-controller="FileViewController" ng-controller="FileViewController"
ng-show="ui.view == 'file'" ng-show="ui.view == 'file'"
ng-if="openFile" ng-if="openFile && editor.multiSelectedCount === 0"
) )
file-view( file-view(
file='file' file='file'

View file

@ -57,6 +57,7 @@ export default EditorManager = (function () {
ide.$scope.$emit('editor:replace-selection', symbol.command) ide.$scope.$emit('editor:replace-selection', symbol.command)
eventTracking.sendMB('symbol-palette-insert') eventTracking.sendMB('symbol-palette-insert')
}, },
multiSelectedCount: 0,
} }
window.addEventListener('editor:insert-symbol', event => { window.addEventListener('editor:insert-symbol', event => {

View file

@ -38,6 +38,7 @@ export default FileTreeManager = class FileTreeManager {
this.$scope.$on('entities:multiSelected', (_event, data) => { this.$scope.$on('entities:multiSelected', (_event, data) => {
this.$scope.$apply(() => { this.$scope.$apply(() => {
this.$scope.multiSelectedCount = data.count this.$scope.multiSelectedCount = data.count
this.$scope.editor.multiSelectedCount = data.count
}) })
}) })
@ -144,7 +145,8 @@ export default FileTreeManager = class FileTreeManager {
toggleMultiSelectEntity(entity) { toggleMultiSelectEntity(entity) {
entity.multiSelected = !entity.multiSelected entity.multiSelected = !entity.multiSelected
return (this.$scope.multiSelectedCount = this.multiSelectedCount()) this.$scope.multiSelectedCount = this.multiSelectedCount()
this.$scope.editor.multiSelectedCount = this.$scope.multiSelectedCount
} }
multiSelectedCount() { multiSelectedCount() {