mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
update txt saving mechanism to mobile client
This commit is contained in:
@@ -142,8 +142,29 @@ class FileToolbar extends React.Component {
|
|||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
||||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle} className="d-block d-md-none">
|
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle} className="d-block d-md-none">
|
||||||
<DropdownToggle className="sf2-icon-more">
|
<ButtonGroup>
|
||||||
</DropdownToggle>
|
{(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}>
|
<DropdownMenu right={true}>
|
||||||
<DropdownItem>
|
<DropdownItem>
|
||||||
<a href={`${siteRoot}library/${repoID}/${Utils.encodePath(repoName + parentDir)}`} className="text-inherit">
|
<a href={`${siteRoot}library/${repoID}/${Utils.encodePath(repoName + parentDir)}`} className="text-inherit">
|
||||||
@@ -167,13 +188,6 @@ class FileToolbar extends React.Component {
|
|||||||
</a>
|
</a>
|
||||||
</DropdownItem>
|
</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 && (
|
{canDownloadFile && (
|
||||||
<DropdownItem>
|
<DropdownItem>
|
||||||
<a href="?dl=1" className="text-inherit">
|
<a href="?dl=1" className="text-inherit">
|
||||||
|
@@ -71,7 +71,7 @@ class ViewFileText extends React.Component {
|
|||||||
this.state.content
|
this.state.content
|
||||||
).then(() => {
|
).then(() => {
|
||||||
toaster.success(gettext('Successfully saved'), {
|
toaster.success(gettext('Successfully saved'), {
|
||||||
duration: 3
|
duration: 2
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
|
Reference in New Issue
Block a user