[DE PE SSE] Fix search restarting
This commit is contained in:
parent
b68c5a7f0c
commit
7a8469925e
|
@ -121,21 +121,28 @@ define([
|
|||
this._state.useRegExp = checked;
|
||||
break;
|
||||
}
|
||||
if (this._state.searchText !== '' && this.onQuerySearch()) {
|
||||
if (this._state.searchText !== '') {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
if (this.onQuerySearch()) {
|
||||
if (this.searchTimer) {
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
}
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onSearchNext: function (type, text, e) {
|
||||
if (text && text.length > 0 && (type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN || type !== 'keydown')) {
|
||||
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
||||
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
||||
this._state.searchText = text;
|
||||
if (this.onQuerySearch(type) && this.searchTimer) {
|
||||
if (this.onQuerySearch(type) && (this.searchTimer || isReturnKey)) {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
if (this.searchTimer) {
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
}
|
||||
if (this.view.$el.is(':visible')) {
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
|
|
|
@ -118,21 +118,28 @@ define([
|
|||
this._state.useRegExp = checked;
|
||||
break;
|
||||
}
|
||||
if (this._state.searchText !== '' && this.onQuerySearch()) {
|
||||
if (this._state.searchText !== '') {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
if (this.onQuerySearch()) {
|
||||
if (this.searchTimer) {
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
}
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onSearchNext: function (type, text, e) {
|
||||
if (text && text.length > 0 && (type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN || type !== 'keydown')) {
|
||||
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
||||
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
||||
this._state.searchText = text;
|
||||
if (this.onQuerySearch(type) && this.searchTimer) {
|
||||
if (this.onQuerySearch(type) && (this.searchTimer || isReturnKey)) {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
if (this.searchTimer) {
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
}
|
||||
if (this.view.$el.is(':visible')) {
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
|
|
|
@ -157,11 +157,13 @@ define([
|
|||
this._state.lookInFormulas = value;
|
||||
break;
|
||||
}
|
||||
if (runSearch && this._state.searchText !== '' && this.onQuerySearch()) {
|
||||
if (runSearch && this._state.searchText !== '') {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
if (this.onQuerySearch()) {
|
||||
this.searchTimer && clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -192,12 +194,15 @@ define([
|
|||
},
|
||||
|
||||
onSearchNext: function (type, text, e) {
|
||||
if (text && text.length > 0 && (type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN || type !== 'keydown')) {
|
||||
var isReturnKey = type === 'keydown' && e.keyCode === Common.UI.Keys.RETURN;
|
||||
if (text && text.length > 0 && (isReturnKey || type !== 'keydown')) {
|
||||
this._state.searchText = text;
|
||||
if (this.onQuerySearch(type) && this.searchTimer) {
|
||||
if (this.onQuerySearch(type) && (this.searchTimer || isReturnKey)) {
|
||||
this.hideResults();
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
if (this.searchTimer) {
|
||||
clearInterval(this.searchTimer);
|
||||
this.searchTimer = undefined;
|
||||
}
|
||||
if (this.view.$el.is(':visible')) {
|
||||
this.api.asc_StartTextAroundSearch();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue