Просмотр исходного кода

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

Bring Multi-Selection UI Back

GitOrigin-RevId: a0e086da98bb1de88cb2e96ddc2acfd5240a01a7
ilkin-overleaf 4 лет назад
Родитель
Сommit
ea729ca2af

+ 7 - 7
services/web/app/views/project/editor/editor-pane.pug

@@ -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)

+ 1 - 1
services/web/app/views/project/editor/file-view.pug

@@ -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'

+ 1 - 0
services/web/frontend/js/ide/editor/EditorManager.js

@@ -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 => {

+ 3 - 1
services/web/frontend/js/ide/file-tree/FileTreeManager.js

@@ -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() {