mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-19 07:27:56 +00:00
change more menu icon (#6273)
This commit is contained in:
parent
e2588debd3
commit
ca6861c8d8
@ -54,7 +54,7 @@ class DirTool extends React.Component {
|
|||||||
return Utils.getFileName(filePath).includes('.md');
|
return Utils.getFileName(filePath).includes('.md');
|
||||||
}
|
}
|
||||||
|
|
||||||
getList2 = () => {
|
getMenu = () => {
|
||||||
const list = [];
|
const list = [];
|
||||||
const { repoID, userPerm, currentPath } = this.props;
|
const { repoID, userPerm, currentPath } = this.props;
|
||||||
const { TAGS, TRASH, HISTORY } = TextTranslation;
|
const { TAGS, TRASH, HISTORY } = TextTranslation;
|
||||||
@ -73,20 +73,15 @@ class DirTool extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
let trashUrl = siteRoot + 'repo/' + repoID + '/trash/';
|
let trashUrl = siteRoot + 'repo/' + repoID + '/trash/';
|
||||||
list.push({...TRASH, href: trashUrl});
|
list.push({...TRASH, href: trashUrl});
|
||||||
|
|
||||||
let historyUrl = siteRoot + 'repo/history/' + repoID + '/';
|
let historyUrl = siteRoot + 'repo/history/' + repoID + '/';
|
||||||
list.push({...HISTORY, href: historyUrl});
|
list.push({...HISTORY, href: historyUrl});
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
|
|
||||||
onMenuItemClick = (item) => {
|
onMenuItemClick = (item) => {
|
||||||
const { key, href } = item;
|
const { key, href } = item;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'Properties':
|
|
||||||
this.props.switchViewMode('detail');
|
|
||||||
break;
|
|
||||||
case 'Tags':
|
case 'Tags':
|
||||||
this.setState({isRepoTagDialogOpen: !this.state.isRepoTagDialogOpen});
|
this.setState({isRepoTagDialogOpen: !this.state.isRepoTagDialogOpen});
|
||||||
break;
|
break;
|
||||||
@ -99,16 +94,6 @@ class DirTool extends React.Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
getMenuList = () => {
|
|
||||||
const list = [];
|
|
||||||
const list2 = this.getList2();
|
|
||||||
const { PROPERTIES, } = TextTranslation;
|
|
||||||
if (!this.props.isCustomPermission) {
|
|
||||||
list.push(PROPERTIES);
|
|
||||||
}
|
|
||||||
return list.concat(list2);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMenuItemKeyDown = (e, item) => {
|
onMenuItemKeyDown = (e, item) => {
|
||||||
if (e.key == 'Enter' || e.key == 'Space') {
|
if (e.key == 'Enter' || e.key == 'Space') {
|
||||||
this.onMenuItemClick(item);
|
this.onMenuItemClick(item);
|
||||||
@ -116,19 +101,25 @@ class DirTool extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const menuItems = this.getMenuList();
|
const menuItems = this.getMenu();
|
||||||
const { isDropdownMenuOpen } = this.state;
|
const { isDropdownMenuOpen } = this.state;
|
||||||
const { repoID, currentMode } = this.props;
|
const { repoID, currentMode } = this.props;
|
||||||
|
const propertiesText = TextTranslation.PROPERTIES.value;
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<ViewModes currentViewMode={currentMode} switchViewMode={this.props.switchViewMode} />
|
<ViewModes currentViewMode={currentMode} switchViewMode={this.props.switchViewMode} />
|
||||||
|
{!this.props.isCustomPermission &&
|
||||||
|
<span className="cur-view-path-btn ml-2" onClick={() => this.props.switchViewMode('detail')}>
|
||||||
|
<span className="sf3-font sf3-font-info" aria-label={propertiesText} title={propertiesText}></span>
|
||||||
|
</span>
|
||||||
|
}
|
||||||
{menuItems.length > 0 &&
|
{menuItems.length > 0 &&
|
||||||
<Dropdown isOpen={isDropdownMenuOpen} toggle={this.toggleDropdownMenu}>
|
<Dropdown isOpen={isDropdownMenuOpen} toggle={this.toggleDropdownMenu}>
|
||||||
<DropdownToggle
|
<DropdownToggle
|
||||||
tag="i"
|
tag="i"
|
||||||
id="cur-folder-more-op-toggle"
|
id="cur-folder-more-op-toggle"
|
||||||
className={'cur-view-path-btn sf3-font-more sf3-font'}
|
className='cur-view-path-btn sf3-font-more sf3-font ml-2'
|
||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
title={gettext('More operations')}
|
title={gettext('More operations')}
|
||||||
aria-label={gettext('More operations')}
|
aria-label={gettext('More operations')}
|
||||||
@ -141,7 +132,12 @@ class DirTool extends React.Component {
|
|||||||
return <DropdownItem key={index} divider />;
|
return <DropdownItem key={index} divider />;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<DropdownItem key={index} onClick={this.onMenuItemClick.bind(this, menuItem)} onKeyDown={this.onMenuItemKeyDown.bind(this, menuItem)}>{menuItem.value}</DropdownItem>
|
<DropdownItem
|
||||||
|
key={index}
|
||||||
|
onClick={this.onMenuItemClick.bind(this, menuItem)}
|
||||||
|
onKeyDown={this.onMenuItemKeyDown.bind(this, menuItem)}
|
||||||
|
>{menuItem.value}
|
||||||
|
</DropdownItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
/* end file-operation toolbar */
|
/* end file-operation toolbar */
|
||||||
#cur-folder-more-op-toggle {
|
#cur-folder-more-op-toggle {
|
||||||
margin-left: 10px;
|
|
||||||
margin-right: -4px;
|
margin-right: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class UserItem extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
toggleResetPW = () => {
|
toggleResetPW = () => {
|
||||||
const { email, name } = this.props.user;
|
const { email } = this.props.user;
|
||||||
toaster.success(gettext('Resetting user\'s password, please wait for a moment.'));
|
toaster.success(gettext('Resetting user\'s password, please wait for a moment.'));
|
||||||
seafileAPI.orgAdminResetOrgUserPassword(orgID, email).then(res => {
|
seafileAPI.orgAdminResetOrgUserPassword(orgID, email).then(res => {
|
||||||
toaster.success(res.data.reset_tip);
|
toaster.success(res.data.reset_tip);
|
||||||
|
Loading…
Reference in New Issue
Block a user