[SSE] Fix replacing empty cells
This commit is contained in:
parent
9e9470315e
commit
31ba6dde66
|
@ -331,7 +331,7 @@ define([
|
||||||
(!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count)));
|
(!count ? this.textNoMatches : Common.Utils.String.format(this.textSearchResults, current + 1, count)));
|
||||||
}
|
}
|
||||||
this.$reaultsNumber.text(text);
|
this.$reaultsNumber.text(text);
|
||||||
this.disableReplaceButtons(!count);
|
!window.SSE && this.disableReplaceButtons(!count);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickClosePanel: function() {
|
onClickClosePanel: function() {
|
||||||
|
|
|
@ -225,10 +225,10 @@ define([
|
||||||
if (me.view.$el.is(':visible')) {
|
if (me.view.$el.is(':visible')) {
|
||||||
me.api.asc_StartTextAroundSearch();
|
me.api.asc_StartTextAroundSearch();
|
||||||
}
|
}
|
||||||
me.view.disableReplaceButtons(false);
|
//me.view.disableReplaceButtons(false);
|
||||||
} else if (me._state.newSearchText === '') {
|
} else if (me._state.newSearchText === '') {
|
||||||
me.view.updateResultsNumber('no-results');
|
me.view.updateResultsNumber('no-results');
|
||||||
me.view.disableReplaceButtons(true);
|
//me.view.disableReplaceButtons(true);
|
||||||
}
|
}
|
||||||
clearInterval(me.searchTimer);
|
clearInterval(me.searchTimer);
|
||||||
me.searchTimer = undefined;
|
me.searchTimer = undefined;
|
||||||
|
@ -265,7 +265,7 @@ define([
|
||||||
if (!this.api.asc_findText(options)) {
|
if (!this.api.asc_findText(options)) {
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
this.view.updateResultsNumber(undefined, 0);
|
this.view.updateResultsNumber(undefined, 0);
|
||||||
this.view.disableReplaceButtons(true);
|
//this.view.disableReplaceButtons(true);
|
||||||
this._state.currentResult = 0;
|
this._state.currentResult = 0;
|
||||||
this._state.resultsNumber = 0;
|
this._state.resultsNumber = 0;
|
||||||
this.view.disableNavButtons();
|
this.view.disableNavButtons();
|
||||||
|
@ -275,7 +275,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onQueryReplace: function(textSearch, textReplace) {
|
onQueryReplace: function(textSearch, textReplace) {
|
||||||
if (textSearch !== '') {
|
|
||||||
this.api.isReplaceAll = false;
|
this.api.isReplaceAll = false;
|
||||||
var options = new Asc.asc_CFindOptions();
|
var options = new Asc.asc_CFindOptions();
|
||||||
options.asc_setFindWhat(textSearch);
|
options.asc_setFindWhat(textSearch);
|
||||||
|
@ -291,7 +290,6 @@ define([
|
||||||
options.asc_setIsReplaceAll(false);
|
options.asc_setIsReplaceAll(false);
|
||||||
|
|
||||||
this.api.asc_replaceText(options);
|
this.api.asc_replaceText(options);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onQueryReplaceAll: function(textSearch, textReplace) {
|
onQueryReplaceAll: function(textSearch, textReplace) {
|
||||||
|
@ -348,7 +346,7 @@ define([
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
this.hideResults();
|
this.hideResults();
|
||||||
this.view.updateResultsNumber(undefined, 0);
|
this.view.updateResultsNumber(undefined, 0);
|
||||||
this.view.disableReplaceButtons(true);
|
//this.view.disableReplaceButtons(true);
|
||||||
this._state.currentResult = 0;
|
this._state.currentResult = 0;
|
||||||
this._state.resultsNumber = 0;
|
this._state.resultsNumber = 0;
|
||||||
this.view.disableNavButtons();
|
this.view.disableNavButtons();
|
||||||
|
@ -495,13 +493,13 @@ define([
|
||||||
|
|
||||||
this.hideResults();
|
this.hideResults();
|
||||||
if (text && text !== '' && text === this._state.searchText) { // search was made
|
if (text && text !== '' && text === this._state.searchText) { // search was made
|
||||||
this.view.disableReplaceButtons(false);
|
//this.view.disableReplaceButtons(false);
|
||||||
this.api.asc_StartTextAroundSearch();
|
this.api.asc_StartTextAroundSearch();
|
||||||
} else if (text && text !== '') { // search wasn't made
|
} else if (text && text !== '') { // search wasn't made
|
||||||
this.onInputSearchChange(text);
|
this.onInputSearchChange(text);
|
||||||
} else {
|
} else {
|
||||||
this.resultItems = [];
|
this.resultItems = [];
|
||||||
this.view.disableReplaceButtons(true);
|
//this.view.disableReplaceButtons(true);
|
||||||
this.view.clearResultsNumber();
|
this.view.clearResultsNumber();
|
||||||
}
|
}
|
||||||
this.view.disableNavButtons(this._state.currentResult, this._state.resultsNumber);
|
this.view.disableNavButtons(this._state.currentResult, this._state.resultsNumber);
|
||||||
|
|
Loading…
Reference in a new issue