Merge pull request #1500 from ONLYOFFICE/feature/bug-fixes

Fix Bug 54797
This commit is contained in:
maxkadushkin 2022-01-26 22:39:07 +03:00 committed by GitHub
commit f74ed73317
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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