[SSE] Fix replacing empty cells

This commit is contained in:
JuliaSvinareva 2022-06-27 15:56:14 +03:00
parent 9e9470315e
commit 31ba6dde66
2 changed files with 21 additions and 23 deletions

View file

@ -331,7 +331,7 @@ define([
(!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count)));
}
this.$reaultsNumber.text(text);
this.disableReplaceButtons(!count);
!window.SSE && this.disableReplaceButtons(!count);
},
onClickClosePanel: function() {

View file

@ -225,10 +225,10 @@ define([
if (me.view.$el.is(':visible')) {
me.api.asc_StartTextAroundSearch();
}
me.view.disableReplaceButtons(false);
//me.view.disableReplaceButtons(false);
} else if (me._state.newSearchText === '') {
me.view.updateResultsNumber('no-results');
me.view.disableReplaceButtons(true);
//me.view.disableReplaceButtons(true);
}
clearInterval(me.searchTimer);
me.searchTimer = undefined;
@ -265,7 +265,7 @@ define([
if (!this.api.asc_findText(options)) {
this.resultItems = [];
this.view.updateResultsNumber(undefined, 0);
this.view.disableReplaceButtons(true);
//this.view.disableReplaceButtons(true);
this._state.currentResult = 0;
this._state.resultsNumber = 0;
this.view.disableNavButtons();
@ -275,7 +275,6 @@ define([
},
onQueryReplace: function(textSearch, textReplace) {
if (textSearch !== '') {
this.api.isReplaceAll = false;
var options = new Asc.asc_CFindOptions();
options.asc_setFindWhat(textSearch);
@ -291,7 +290,6 @@ define([
options.asc_setIsReplaceAll(false);
this.api.asc_replaceText(options);
}
},
onQueryReplaceAll: function(textSearch, textReplace) {
@ -348,7 +346,7 @@ define([
this.resultItems = [];
this.hideResults();
this.view.updateResultsNumber(undefined, 0);
this.view.disableReplaceButtons(true);
//this.view.disableReplaceButtons(true);
this._state.currentResult = 0;
this._state.resultsNumber = 0;
this.view.disableNavButtons();
@ -495,13 +493,13 @@ define([
this.hideResults();
if (text && text !== '' && text === this._state.searchText) { // search was made
this.view.disableReplaceButtons(false);
//this.view.disableReplaceButtons(false);
this.api.asc_StartTextAroundSearch();
} else if (text && text !== '') { // search wasn't made
this.onInputSearchChange(text);
} else {
this.resultItems = [];
this.view.disableReplaceButtons(true);
//this.view.disableReplaceButtons(true);
this.view.clearResultsNumber();
}
this.view.disableNavButtons(this._state.currentResult, this._state.resultsNumber);