commit
cdbcfb4e24
|
@ -58,6 +58,7 @@
|
|||
api = appApi;
|
||||
if (api) {
|
||||
api.asc_registerCallback('asc_onSetSearchCurrent', onApiUpdateSearchCurrent);
|
||||
api.asc_registerCallback('asc_onActiveSheetChanged', onActiveSheetChanged);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -117,7 +118,7 @@
|
|||
if ((new Date()) - _lastInputChange < 400) return;
|
||||
|
||||
_state.searchText = _state.newSearchText;
|
||||
(_state.newSearchText !== '') && onQuerySearch();
|
||||
onQuerySearch();
|
||||
clearInterval(_searchTimer);
|
||||
_searchTimer = undefined;
|
||||
}, 10);
|
||||
|
@ -125,7 +126,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
var onQuerySearch = function (d, w) {
|
||||
var onQuerySearch = function (d, isNeedRecalc) {
|
||||
var options = new Asc.asc_CFindOptions();
|
||||
options.asc_setFindWhat(_state.searchText);
|
||||
options.asc_setScanForward(d != 'back');
|
||||
|
@ -134,6 +135,8 @@
|
|||
options.asc_setScanOnOnlySheet(Asc.c_oAscSearchBy.Sheet);
|
||||
options.asc_setScanByRows(true);
|
||||
options.asc_setLookIn(Asc.c_oAscFindLookIn.Formulas);
|
||||
options.asc_setNeedRecalc(isNeedRecalc);
|
||||
options.asc_setNotSearchEmptyCells(true);
|
||||
if (!api.asc_findText(options)) {
|
||||
common.view.SearchBar.disableNavButtons();
|
||||
return false;
|
||||
|
@ -142,7 +145,7 @@
|
|||
};
|
||||
|
||||
var onSearchNext = function (type, text, e) {
|
||||
if (text && text.length > 0 && (type === 'keydown' && e.keyCode === 13 || type !== 'keydown')) {
|
||||
if (type === 'keydown' && e.keyCode === 13 || type !== 'keydown') {
|
||||
_state.searchText = text;
|
||||
if (onQuerySearch(type) && _searchTimer) {
|
||||
clearInterval(_searchTimer);
|
||||
|
@ -162,6 +165,10 @@
|
|||
}
|
||||
};
|
||||
|
||||
var onActiveSheetChanged = function () {
|
||||
onQuerySearch(undefined, true);
|
||||
};
|
||||
|
||||
return {
|
||||
init: function(config) { appConfig = config; },
|
||||
setApi: setApi,
|
||||
|
|
Loading…
Reference in a new issue