1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 20:01:10 +00:00

Dir view file view toolbar redesign (#6122)

* [dir view] redesigned the toolbar for 'view a markdown file'

* [dir view] markdown file view: don't use secondary dropdown menu for the toolbar
This commit is contained in:
llj
2024-05-28 18:17:53 +08:00
committed by GitHub
parent c604bb2a94
commit af3522d312
6 changed files with 229 additions and 116 deletions

View File

@@ -138,7 +138,8 @@ class DirOperationToolbar extends React.Component {
toggleSubMenu = (e) => {
e.stopPropagation();
this.setState({
isSubMenuShown: !this.state.isSubMenuShown}, () => {
isSubMenuShown: !this.state.isSubMenuShown
}, () => {
this.toggleDesktopOpMenu();
});
};
@@ -186,7 +187,11 @@ class DirOperationToolbar extends React.Component {
]
});
} else {
opList.push({'text': gettext('Upload'), 'onClick': this.onUploadFile});
opList.push({
'icon': 'upload-files',
'text': gettext('Upload'),
'onClick': this.onUploadFile
});
}
}
@@ -206,7 +211,7 @@ class DirOperationToolbar extends React.Component {
opList.push({
'icon': 'new',
'text': gettext('New'),
subOpList: newSubOpList
'subOpList': newSubOpList
});
}
@@ -266,10 +271,12 @@ class DirOperationToolbar extends React.Component {
</Dropdown>
);
} else {
return (<DropdownItem key={index} onClick={item.onClick} onKeyDown={this.onMenuItemKeyDown.bind(this, item)}>
<i className={`sf3-font-${item.icon} sf3-font mr-2 dropdown-item-icon`}></i>
{item.text}
</DropdownItem>);
return (
<DropdownItem key={index} onClick={item.onClick} onKeyDown={this.onMenuItemKeyDown.bind(this, item)}>
<i className={`sf3-font-${item.icon} sf3-font mr-2 dropdown-item-icon`}></i>
{item.text}
</DropdownItem>
);
}
})}
</DropdownMenu>