From 324b301ece3c90957c47dd6bf928200332a7059a Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Wed, 25 Sep 2024 19:10:42 +0500 Subject: [PATCH 1/2] fix bug 66442 --- common/loginpage/src/panelrecent.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/common/loginpage/src/panelrecent.js b/common/loginpage/src/panelrecent.js index b1c91b105..78f38a0cf 100644 --- a/common/loginpage/src/panelrecent.js +++ b/common/loginpage/src/panelrecent.js @@ -158,30 +158,6 @@ elm.append($('')); }); - }, - updatelistsize: function() { - // set fixed height for scrollbar appearing. - var _available_height = this.$panel.height(); - var _box_recent_height = _available_height; - - if (!this.$boxRecovery.find('tr').size()) { - // $boxRecent.height($boxRecent.parent().height()); - } else { - _available_height -= /*separatorHeight*/40; - _box_recent_height *= 0.5; - - this.$boxRecovery.height(_available_height * 0.5); - - var $table_box = this.$boxRecovery.find('.table-box'); - if ( !$table_box.hasScrollBar() ) { - let _new_recovery_height = $table_box.find('.table-files.list').height() + /*$headerRecovery.height()*/46; - this.$boxRecovery.height(_new_recovery_height); - - _box_recent_height = _available_height - _new_recovery_height; - } - } - - /*$boxRecent.height() != _box_recent_height &&*/ this.$boxRecent.height(_box_recent_height); } }); @@ -264,7 +240,6 @@ this.view.$boxRecovery[collectionRecovers.size() > 0 ? 'show' : 'hide'](); this.view.$panel.find('#recovery-sep')[collectionRecovers.size() > 0 ? 'show' : 'hide'](); - this.view.updatelistsize(); }; function _init_collections() { @@ -440,9 +415,6 @@ } }); - $(window).resize(()=>{ - this.view.updatelistsize(); - }); CommonEvents.on("icons:svg", this.view.onscale); CommonEvents.on('portal:authorized', (data)=>{ if ( data.type == 'fileid' ) { From c72f9af7b9cd6514cc900f18a9d65fb02b5ca2c7 Mon Sep 17 00:00:00 2001 From: Konstantin Kireyev Date: Fri, 27 Sep 2024 02:27:43 +0500 Subject: [PATCH 2/2] fix: recent and recovery box display --- common/loginpage/src/panelrecent.js | 25 +++++++++++++++++++------ common/loginpage/src/styles.less | 18 ++++++++++-------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/common/loginpage/src/panelrecent.js b/common/loginpage/src/panelrecent.js index 78f38a0cf..3c34dff59 100644 --- a/common/loginpage/src/panelrecent.js +++ b/common/loginpage/src/panelrecent.js @@ -53,7 +53,7 @@ // args.id&&(args.id=`"id=${args.id}"`)||(args.id=''); let _html = `
-
+

${_lang.listRecoveryTitle}

@@ -62,7 +62,6 @@
-
@@ -99,6 +98,9 @@ this.$boxRecovery = this.$panel.find('#box-recovery'); this.$boxRecent = this.$panel.find('#box-recent'); + this.$panelContainer = this.$panel.find('.recent-panel-container'); + this.$tableBoxRecovery = this.$boxRecovery.find('.table-box').get(0); + this.$tableBoxRecent = this.$boxRecent.find('.table-box').get(0); }, listitemtemplate: function(info) { let id = !!info.uid ? (` id="${info.uid}"`) : ''; @@ -158,7 +160,13 @@ elm.append($('')); }); - } + }, + updateListSize: function() { + const hasRecoveryScroll = this.$tableBoxRecovery.scrollHeight > this.$tableBoxRecovery.clientHeight; + const hasRecentScroll = this.$tableBoxRecent.scrollHeight > this.$tableBoxRecent.clientHeight; + + this.$panelContainer.css('grid-template-rows', hasRecoveryScroll || hasRecentScroll ? '' : 'auto 1fr'); + }, }); window.ControllerRecent = ControllerRecent; @@ -216,6 +224,8 @@ } else { this.rawRecents = undefined; } + + this.view.updateListSize(); }; var _on_recents = function(params) { @@ -239,12 +249,12 @@ } this.view.$boxRecovery[collectionRecovers.size() > 0 ? 'show' : 'hide'](); - this.view.$panel.find('#recovery-sep')[collectionRecovers.size() > 0 ? 'show' : 'hide'](); + this.view.updateListSize(); }; function _init_collections() { - let _cl_rcbox = this.view.$panel.find('#box-recent'), - _cl_rvbox = this.view.$panel.find('#box-recovery'); + let _cl_rcbox = this.view.$boxRecent, + _cl_rvbox = this.view.$boxRecovery; collectionRecents = new Collection({ view: _cl_rcbox, @@ -415,6 +425,9 @@ } }); + $(window).resize(()=>{ + this.view.updateListSize(); + }); CommonEvents.on("icons:svg", this.view.onscale); CommonEvents.on('portal:authorized', (data)=>{ if ( data.type == 'fileid' ) { diff --git a/common/loginpage/src/styles.less b/common/loginpage/src/styles.less index 886540c4a..8cb82e4bd 100644 --- a/common/loginpage/src/styles.less +++ b/common/loginpage/src/styles.less @@ -420,22 +420,24 @@ li.menu-item { overflow: hidden; } -#recovery-sep { - height: 40px; - display: none; +.recent-panel-container { + display: grid; + gap: 40px; + height: 100%; + grid-template-rows: auto; } #box-recovery { display: none; - .flex-fill { - overflow-y: auto; - overflow-x: hidden; - } + .flex-fill { + overflow-y: auto; + overflow-x: hidden; + flex-grow: 0; + } } #box-recent { - .flexbox { .flex-fill { overflow-y: auto;