[SSE] Fix Bug 54510
This commit is contained in:
parent
c2735e8606
commit
85ce25f505
|
@ -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">
|
||||
|
|
|
@ -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} />
|
||||
|
|
Loading…
Reference in a new issue