From 61e85d0011cf2f1c294a19157fc3f229a5b999c8 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Thu, 9 May 2024 16:09:30 +0800 Subject: [PATCH] fix admin share animation --- frontend/src/components/main-side-nav.js | 11 +++++------ media/css/seahub_react.css | 8 +++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/main-side-nav.js b/frontend/src/components/main-side-nav.js index 77e26c9621e..9888bce5f6d 100644 --- a/frontend/src/components/main-side-nav.js +++ b/frontend/src/components/main-side-nav.js @@ -14,6 +14,8 @@ const propTypes = { tabItemClick: PropTypes.func.isRequired, }; +const SUB_NAV_ITEM_HEIGHT = 28; + class MainSideNav extends React.Component { constructor(props) { super(props); @@ -23,8 +25,6 @@ class MainSideNav extends React.Component { closeSideBar:false, groupItems: [], }; - - this.listHeight = 24; //for caculate tabheight this.adminHeight = 0; this.filesNavHeight = 0; } @@ -43,8 +43,7 @@ class MainSideNav extends React.Component { return group; }); - const groupItemHeight = 28; - this.filesNavHeight = (groupList.length + (canAddRepo ? 1 : 0) + (canViewOrg ? 1 : 0) + 1) * groupItemHeight; + this.filesNavHeight = (groupList.length + (canAddRepo ? 1 : 0) + (canViewOrg ? 1 : 0) + 1) * SUB_NAV_ITEM_HEIGHT; _this.setState({ groupItems: groupList.sort((a, b) => { return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1; @@ -98,7 +97,7 @@ class MainSideNav extends React.Component { let height = 0; if (this.state.sharedExtended) { if (!this.adminHeight) { - this.adminHeight = 3 * this.listHeight; + this.adminHeight = 3 * SUB_NAV_ITEM_HEIGHT; } height = this.adminHeight; } @@ -125,7 +124,7 @@ class MainSideNav extends React.Component { ); } return ( -