Merge pull request #1414 from ONLYOFFICE/feature/fix-bug-reactjs

Feature/fix bug reactjs
This commit is contained in:
maxkadushkin 2021-12-15 11:15:55 +03:00 committed by GitHub
commit 2871048bf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 13 deletions

View file

@ -162,7 +162,7 @@ class SearchView extends Component {
}
onReplaceClick() {
if (this.searchbar && this.state.searchQuery) {
if (this.searchbar && this.state.replaceQuery) {
if (this.props.onReplaceQuery) {
let params = this.searchParams();
params.find = this.state.searchQuery;
@ -174,7 +174,7 @@ class SearchView extends Component {
}
onReplaceAllClick() {
if (this.searchbar && this.state.searchQuery) {
if (this.searchbar && this.state.replaceQuery) {
if (this.props.onReplaceAllQuery) {
let params = this.searchParams();
params.find = this.state.searchQuery;
@ -281,9 +281,9 @@ class SearchView extends Component {
{/* <a id="replace-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
<a id="replace-all-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} style={!usereplace ? hidden: null} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a> */}
{isReplaceAll ? (
<a id="replace-all-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a>
<a id="replace-all-link" className={"link " + (replaceQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceAllClick()}>{_t.textReplaceAll}</a>
) : usereplace ? (
<a id="replace-link" className={"link " + (searchQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
<a id="replace-link" className={"link " + (replaceQuery.trim().length ? "" : "disabled")} onClick={() => this.onReplaceClick()}>{_t.textReplace}</a>
) : null}
</div>
<div className="buttons-row">

View file

@ -13,9 +13,9 @@
.content-block {
margin: 0 auto 15px;
a {
color: @text-normal;
}
// a {
// color: @text-normal;
// }
}
.settings-about-logo {

View file

@ -148,8 +148,8 @@
.about {
.content-block {
margin: 0 auto 15px;
a {
color: @black;
p:last-child {
text-decoration: underline;
}
}
}

View file

@ -183,7 +183,7 @@ const Search = withTranslation()(props => {
let searchIn = +params.searchIn === 1;
let searchBy = +params.searchBy === 0;
if (params.find && params.find.length) {
// if (params.find && params.find.length) {
api.isReplaceAll = false;
let options = new Asc.asc_CFindOptions();
@ -198,7 +198,7 @@ const Search = withTranslation()(props => {
options.asc_setIsReplaceAll(false);
api.asc_replaceText(options);
}
// }
}
const onReplaceAllQuery = params => {
@ -207,7 +207,7 @@ const Search = withTranslation()(props => {
let searchIn = +params.searchIn === 1;
let searchBy = +params.searchBy === 0;
if (params.find && params.find.length) {
// if (params.find && params.find.length) {
api.isReplaceAll = true;
let options = new Asc.asc_CFindOptions();
@ -222,7 +222,7 @@ const Search = withTranslation()(props => {
options.asc_setIsReplaceAll(true);
api.asc_replaceText(options);
}
// }
}
return <SESearchView _t={_t} onSearchQuery={onSearchQuery} onchangeSearchQuery={onchangeSearchQuery} onReplaceQuery={onReplaceQuery} onReplaceAllQuery={onReplaceAllQuery} />