mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-16 15:19:06 +00:00
Improve variable name
This commit is contained in:
@@ -21,7 +21,7 @@ class DirTool extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
showTagPopup: false,
|
isRepoTagDialogShow: false,
|
||||||
currentTag: null,
|
currentTag: null,
|
||||||
isListRepoTagShow: false,
|
isListRepoTagShow: false,
|
||||||
isUpdateRepoTagShow: false,
|
isUpdateRepoTagShow: false,
|
||||||
@@ -30,9 +30,29 @@ class DirTool extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onShowListRepoTag = () => {
|
||||||
|
this.setState({
|
||||||
|
isRepoTagDialogShow: true,
|
||||||
|
isListRepoTagShow: true,
|
||||||
|
isUpdateRepoTagShow: false,
|
||||||
|
isCreateRepoTagShow: false,
|
||||||
|
isListTaggedFileShow: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onCloseRepoTagDialog = () => {
|
||||||
|
this.setState({
|
||||||
|
isRepoTagDialogShow: false,
|
||||||
|
isListRepoTagShow: false,
|
||||||
|
isUpdateRepoTagShow: false,
|
||||||
|
isCreateRepoTagShow: false,
|
||||||
|
isListTaggedFileShow: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onListRepoTagToggle = () => {
|
onListRepoTagToggle = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
showTagPopup: !this.state.showTagPopup,
|
isTagDialogShow: !this.state.isTagDialogShow,
|
||||||
isListRepoTagShow: !this.state.isListRepoTagShow
|
isListRepoTagShow: !this.state.isListRepoTagShow
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -44,12 +64,14 @@ class DirTool extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
onCreateRepoTagPopupToggle = () => {
|
onCreateRepoTagPopupToggle = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isCreateRepoTagShow: !this.state.isCreateRepoTagShow,
|
isCreateRepoTagShow: !this.state.isCreateRepoTagShow,
|
||||||
showTagPopup: !this.state.showTagPopup
|
isTagDialogShow: !this.state.isTagDialogShow
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
onUpdateRepoTagToggle = (currentTag) => {
|
onUpdateRepoTagToggle = (currentTag) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -59,12 +81,14 @@ class DirTool extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
onUpdateRepoTagPopupToggle = () => {
|
onUpdateRepoTagPopupToggle = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isUpdateRepoTagShow: !this.state.isUpdateRepoTagShow,
|
isUpdateRepoTagShow: !this.state.isUpdateRepoTagShow,
|
||||||
showTagPopup: !this.state.showTagPopup
|
isTagDialogShow: !this.state.isTagDialogShow
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
onListTaggedFileToggle = (currentTag) => {
|
onListTaggedFileToggle = (currentTag) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -74,12 +98,14 @@ class DirTool extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
onListTaggedFilePopupToggle = () => {
|
onListTaggedFilePopupToggle = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isListTaggedFileShow: !this.state.isListTaggedFileShow,
|
isListTaggedFileShow: !this.state.isListTaggedFileShow,
|
||||||
showTagPopup: !this.state.showTagPopup
|
isTagDialogShow: !this.state.isTagDialogShow
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
isMarkdownFile(filePath) {
|
isMarkdownFile(filePath) {
|
||||||
let name = Utils.getFileName(filePath);
|
let name = Utils.getFileName(filePath);
|
||||||
@@ -96,18 +122,18 @@ class DirTool extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ul className="path-toolbar">
|
<ul className="path-toolbar">
|
||||||
<li className="toolbar-item"><a className="op-link sf2-icon-tag" onClick={this.onListRepoTagToggle} title={gettext('Tags')} aria-label={gettext('Tags')}></a></li>
|
<li className="toolbar-item"><a className="op-link sf2-icon-tag" onClick={this.onShowListRepoTag} title={gettext('Tags')} aria-label={gettext('Tags')}></a></li>
|
||||||
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
<li className="toolbar-item"><a className="op-link sf2-icon-trash" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a></li>
|
||||||
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{this.state.showTagPopup && (
|
{this.state.isRepoTagDialogShow && (
|
||||||
<ModalPortal>
|
<ModalPortal>
|
||||||
<Modal isOpen={true}>
|
<Modal isOpen={true}>
|
||||||
{this.state.isListRepoTagShow && (
|
{this.state.isListRepoTagShow && (
|
||||||
<ListTagDialog
|
<ListTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
onListTagCancel={this.onListRepoTagToggle}
|
onListTagCancel={this.onCloseRepoTagDialog}
|
||||||
onCreateRepoTag={this.onCreateRepoTagToggle}
|
onCreateRepoTag={this.onCreateRepoTagToggle}
|
||||||
onUpdateRepoTag={this.onUpdateRepoTagToggle}
|
onUpdateRepoTag={this.onUpdateRepoTagToggle}
|
||||||
onListTaggedFiles={this.onListTaggedFileToggle}
|
onListTaggedFiles={this.onListTaggedFileToggle}
|
||||||
@@ -117,7 +143,7 @@ class DirTool extends React.Component {
|
|||||||
{this.state.isCreateRepoTagShow && (
|
{this.state.isCreateRepoTagShow && (
|
||||||
<CreateTagDialog
|
<CreateTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
togglePopup={this.onCreateRepoTagPopupToggle}
|
onClose={this.onCloseRepoTagDialog}
|
||||||
toggleCancel={this.onCreateRepoTagToggle}
|
toggleCancel={this.onCreateRepoTagToggle}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -126,7 +152,7 @@ class DirTool extends React.Component {
|
|||||||
<UpdateTagDialog
|
<UpdateTagDialog
|
||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
currentTag={this.state.currentTag}
|
currentTag={this.state.currentTag}
|
||||||
togglePopup={this.onUpdateRepoTagPopupToggle}
|
onClose={this.onCloseRepoTagDialog}
|
||||||
toggleCancel={this.onUpdateRepoTagToggle}
|
toggleCancel={this.onUpdateRepoTagToggle}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -135,7 +161,7 @@ class DirTool extends React.Component {
|
|||||||
<ListTaggedFilesDialog
|
<ListTaggedFilesDialog
|
||||||
repoID={this.props.repoID}
|
repoID={this.props.repoID}
|
||||||
currentTag={this.state.currentTag}
|
currentTag={this.state.currentTag}
|
||||||
togglePopup={this.onListTaggedFilePopupToggle}
|
onClose={this.onCloseRepoTagDialog}
|
||||||
toggleCancel={this.onListTaggedFileToggle}
|
toggleCancel={this.onListTaggedFileToggle}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@@ -61,7 +61,7 @@ class CreateTagDialog extends React.Component {
|
|||||||
let colorList = this.state.colorList;
|
let colorList = this.state.colorList;
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ModalHeader toggle={this.props.togglePopup}>
|
<ModalHeader toggle={this.props.onClose}>
|
||||||
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
||||||
{gettext('New Tag')}
|
{gettext('New Tag')}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
@@ -45,7 +45,7 @@ class ListTaggedFilesDialog extends React.Component {
|
|||||||
let taggedFileList = this.state.taggedFileList;
|
let taggedFileList = this.state.taggedFileList;
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ModalHeader toggle={this.props.togglePopup}>
|
<ModalHeader toggle={this.props.onClose}>
|
||||||
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
||||||
{gettext('Tagged Files')}
|
{gettext('Tagged Files')}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
@@ -74,7 +74,7 @@ class UpdateTagDialog extends React.Component {
|
|||||||
let colorList = this.state.colorList;
|
let colorList = this.state.colorList;
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<ModalHeader toggle={this.props.togglePopup}>
|
<ModalHeader toggle={this.props.onClose}>
|
||||||
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
<span className="tag-popup-back fas fa-sm fa-arrow-left" onClick={this.props.toggleCancel} aria-label={gettext('Back')}></span>
|
||||||
{gettext('Edit Tag')}
|
{gettext('Edit Tag')}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
Reference in New Issue
Block a user