From 7abc04c3f61ab7b3633912a6fef139adbc0cfd06 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Fri, 7 Jul 2023 20:58:25 +0300 Subject: [PATCH 1/3] Fix recent files list --- apps/documenteditor/main/app/controller/Main.js | 6 ++++-- apps/documenteditor/main/resources/less/filemenu.less | 3 ++- apps/presentationeditor/main/resources/less/leftmenu.less | 3 ++- apps/spreadsheeteditor/main/resources/less/leftmenu.less | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b7d1e7ec49..4a054149ae 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -421,8 +421,10 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if( Common.Controllers.Desktop.isActive() ){ - !this.editorConfig.recent && (this.editorConfig.recent = []); + if( this.appOptions.isDesktopApp ){ + var desktopRecent = Common.Controllers.Desktop.recentFiles(); + if (desktopRecent && desktopRecent.length > 0) + this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 5123a2a53c..da40e9b036 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -422,6 +422,7 @@ .recent-icon { display: inline-block; + .float-left(); width: 24px; height: 30px; margin-top: 1px; @@ -510,7 +511,7 @@ > div:not(:first-child) { display: block; - padding-left: 10px; + .padding-left-10(); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 6787d4890e..4764ea70e3 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -415,6 +415,7 @@ width: 24px; height: 30px; margin-top: 1px; + .float-left(); div { width: 100%; height: 100%; @@ -476,7 +477,7 @@ > div:not(:first-child) { display: block; - padding-left: 10px; + .padding-left-10(); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 18d03001d4..d548c49ffa 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -507,6 +507,7 @@ width: 24px; height: 30px; margin-top: 1px; + .float-left(); div { width: 100%; height: 100%; @@ -565,7 +566,7 @@ > div:not(:first-child) { display: block; - padding-left: 10px; + .padding-left-10(); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; From c5effdebbf2ef6ae3835e1a7d43a2c2662e952c0 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 11 Jul 2023 18:45:52 +0300 Subject: [PATCH 2/3] [all] debug --- apps/documenteditor/main/app/controller/Main.js | 6 ++---- apps/presentationeditor/main/app/controller/Main.js | 6 ++---- apps/presentationeditor/main/app/view/FileMenu.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/Main.js | 6 ++---- apps/spreadsheeteditor/main/app/view/FileMenu.js | 4 ++++ 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 4a054149ae..3b8856fc77 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -421,10 +421,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if( this.appOptions.isDesktopApp ){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ) { + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 77206cb02a..8926ad2d37 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -378,10 +378,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if(this.appOptions.isDesktopApp){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ) { + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 8177dbeca3..8198d70784 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -333,6 +333,10 @@ define([ } this.applyMode(); + if ( Common.Controllers.Desktop.isActive() ) { + Common.NotificationCenter.trigger('update:recents', Common.Controllers.Desktop.recentFiles()); + } + if ( !!this.api ) { this.panels['info'].setApi(this.api); if (this.panels['opts']) this.panels['opts'].setApi(this.api); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 2739e9753a..3a483f360a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -423,10 +423,8 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop' || Common.Controllers.Desktop.isActive(); - if(this.appOptions.isDesktopApp){ - var desktopRecent = Common.Controllers.Desktop.recentFiles(); - if (desktopRecent && desktopRecent.length > 0) - this.editorConfig.recent = !this.editorConfig.recent ? desktopRecent : this.editorConfig.recent = this.editorConfig.recent.concat(desktopRecent); + if( Common.Controllers.Desktop.isActive() ){ + !this.editorConfig.recent && (this.editorConfig.recent = []); } this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 64938ad720..df0deefbe6 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -315,6 +315,10 @@ define([ } this.applyMode(); + if ( Common.Controllers.Desktop.isActive() ) { + Common.NotificationCenter.trigger('update:recents', Common.Controllers.Desktop.recentFiles()); + } + if ( !!this.api ) { this.panels['info'].setApi(this.api); if ( this.panels['protect'] ) From 640da25a62e23015123cc32a486680f2c7705c18 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 11 Jul 2023 22:30:25 +0300 Subject: [PATCH 3/3] remove x-scroll --- apps/documenteditor/main/resources/less/filemenu.less | 2 +- apps/presentationeditor/main/resources/less/leftmenu.less | 2 +- apps/spreadsheeteditor/main/resources/less/leftmenu.less | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index da40e9b036..9c0c6e24e1 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -405,7 +405,7 @@ .item { border: none; - width: calc(100% - 3px); + width: calc(100% - 4px); .box-shadow(none); } diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 4764ea70e3..b08b267a5b 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -396,7 +396,7 @@ .item { border: none; - width: calc(100% - 3px); + width: calc(100% - 4px); .box-shadow(none); } diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index d548c49ffa..b7599f654a 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -488,7 +488,7 @@ .item { border: none; - width: calc(100% - 3px); + width: calc(100% - 4px); .box-shadow(none); }