1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

[a11y] added 'keyboard access' for 'dir view - dirent' & fixed bugs

This commit is contained in:
llj
2021-09-29 15:23:02 +08:00
parent b5d3a6cf6b
commit aef44a8605
8 changed files with 70 additions and 111 deletions

View File

@@ -9,10 +9,6 @@ const propTypes = {
class AboutDialog extends React.Component {
toggle = () => {
this.props.onCloseAboutDialog();
}
renderExternalAboutLinks = () => {
if (additionalAboutDialogLinks && (typeof additionalAboutDialogLinks) === 'object') {
let keys = Object.keys(additionalAboutDialogLinks);
@@ -26,21 +22,22 @@ class AboutDialog extends React.Component {
render() {
let href = lang === lang == 'zh-cn' ? 'http://seafile.com/about/' : 'http://seafile.com/en/about/';
const { onCloseAboutDialog: toggleDialog } = this.props;
if (aboutDialogCustomHtml) {
return (
<Modal isOpen={true} toggle={this.toggle}>
<Modal isOpen={true} toggle={toggleDialog}>
<ModalBody>
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
<button type="button" className="close" onClick={toggleDialog}><span aria-hidden="true">×</span></button>
<div className="about-content" dangerouslySetInnerHTML={{__html: aboutDialogCustomHtml}}></div>
</ModalBody>
</Modal>
);
} else {
return (
<Modal isOpen={true} toggle={this.toggle}>
<Modal isOpen={true} toggle={toggleDialog}>
<ModalBody>
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
<button type="button" className="close" onClick={toggleDialog}><span aria-hidden="true">×</span></button>
<div className="about-content">
<p><img src={mediaUrl + logoPath} height={logoHeight} width={logoWidth} title={siteTitle} alt="logo" /></p>
<p>{gettext('Server Version: ')}{seafileVersion}<br />© {(new Date()).getFullYear()} {gettext('Seafile')}</p>

View File

@@ -26,10 +26,6 @@ class DeleteRepoDialog extends Component {
}
}
toggle = () => {
this.props.toggle();
}
onDeleteRepo = () => {
this.setState({isRequestSended: true}, () => {
this.props.onDeleteRepo(this.props.repo);
@@ -44,14 +40,16 @@ class DeleteRepoDialog extends Component {
let message = gettext('Are you sure you want to delete %s ?');
message = message.replace('%s', repoName);
const { toggle: toggleDialog } = this.props;
return (
<Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle}>{gettext('Delete Library')}</ModalHeader>
<Modal isOpen={true} toggle={toggleDialog}>
<ModalHeader toggle={toggleDialog}>{gettext('Delete Library')}</ModalHeader>
<ModalBody>
<p dangerouslySetInnerHTML={{__html: message}}></p>
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
<Button color="secondary" onClick={toggleDialog}>{gettext('Cancel')}</Button>
<Button color="primary" disabled={isRequestSended} onClick={this.onDeleteRepo}>{gettext('Delete')}</Button>
</ModalFooter>
</Modal>