mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
update txt saving mechanism to mobile client
This commit is contained in:
@@ -142,8 +142,29 @@ class FileToolbar extends React.Component {
|
||||
</ButtonGroup>
|
||||
|
||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle} className="d-block d-md-none">
|
||||
<ButtonGroup>
|
||||
{(canEditFile && !err) &&
|
||||
( this.props.isSaving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button> :
|
||||
(
|
||||
this.props.isContentChangedButNotSaved ?
|
||||
<IconButton
|
||||
text={gettext('Save')}
|
||||
id={'saveButton'}
|
||||
icon={'fa fa-save'}
|
||||
// button imported in this file does not have functionalities of
|
||||
// isActive as button imported in markdowneditor has
|
||||
//isActive={!isContentChanged}
|
||||
onClick={this.props.onSaveChangedContent}
|
||||
/> :
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'} disabled>
|
||||
<i className={'fa fa-save'}/></button>
|
||||
)
|
||||
)}
|
||||
<DropdownToggle className="sf2-icon-more">
|
||||
</DropdownToggle>
|
||||
</ButtonGroup>
|
||||
<DropdownMenu right={true}>
|
||||
<DropdownItem>
|
||||
<a href={`${siteRoot}library/${repoID}/${Utils.encodePath(repoName + parentDir)}`} className="text-inherit">
|
||||
@@ -167,13 +188,6 @@ class FileToolbar extends React.Component {
|
||||
</a>
|
||||
</DropdownItem>
|
||||
)}
|
||||
{(canEditFile && !err) && (
|
||||
<DropdownItem>
|
||||
<a href={`${siteRoot}repo/${repoID}/file/edit/?p=${encodeURIComponent(filePath)}&file_enc=${encodeURIComponent(fileEnc)}`} className="text-inherit">
|
||||
{gettext('Edit')}
|
||||
</a>
|
||||
</DropdownItem>
|
||||
)}
|
||||
{canDownloadFile && (
|
||||
<DropdownItem>
|
||||
<a href="?dl=1" className="text-inherit">
|
||||
|
@@ -71,7 +71,7 @@ class ViewFileText extends React.Component {
|
||||
this.state.content
|
||||
).then(() => {
|
||||
toaster.success(gettext('Successfully saved'), {
|
||||
duration: 3
|
||||
duration: 2
|
||||
});
|
||||
this.setState({
|
||||
isSaving: false,
|
||||
|
Reference in New Issue
Block a user