Merge pull request #1518 from ONLYOFFICE/feature/search-callback
Use callback in search function
This commit is contained in:
commit
7d19d36a13
|
@ -560,15 +560,15 @@ define([
|
|||
|
||||
onQuerySearch: function(d, w, opts) {
|
||||
if (opts.textsearch && opts.textsearch.length) {
|
||||
if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase, opts.matchword)) {
|
||||
var me = this;
|
||||
Common.UI.info({
|
||||
msg: this.textNoTextFound,
|
||||
var me = this;
|
||||
this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase, function(resultCount) {
|
||||
!resultCount && Common.UI.info({
|
||||
msg: me.textNoTextFound,
|
||||
callback: function() {
|
||||
me.dlgSearch.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -108,12 +108,12 @@ const Search = withTranslation()(props => {
|
|||
f7.popover.close('.document-menu.modal-in', false);
|
||||
|
||||
if (params.find && params.find.length) {
|
||||
|
||||
if(params.highlight) api.asc_selectSearchingResults(true);
|
||||
|
||||
if (!api.asc_findText(params.find, params.forward, params.caseSensitive, params.highlight) ) {
|
||||
f7.dialog.alert(null, _t.textNoTextFound);
|
||||
}
|
||||
|
||||
if (params.highlight) api.asc_selectSearchingResults(true);
|
||||
|
||||
api.asc_findText(params.find, params.forward, params.caseSensitive, function (resultCount) {
|
||||
!resultCount && f7.dialog.alert(null, _t.textNoTextFound);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -438,15 +438,15 @@ define([
|
|||
|
||||
onQuerySearch: function(d, w, opts) {
|
||||
if (opts.textsearch && opts.textsearch.length) {
|
||||
if (!this.api.findText(opts.textsearch, d != 'back', opts.matchcase)) {
|
||||
var me = this;
|
||||
Common.UI.info({
|
||||
msg: this.textNoTextFound,
|
||||
var me = this;
|
||||
this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase, function(resultCount) {
|
||||
!resultCount && Common.UI.info({
|
||||
msg: me.textNoTextFound,
|
||||
callback: function() {
|
||||
me.dlgSearch.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -88,9 +88,10 @@ const Search = withTranslation()(props => {
|
|||
f7.popover.close('.document-menu.modal-in', false);
|
||||
|
||||
if (params.find && params.find.length) {
|
||||
if (!api.findText(params.find, params.forward, params.caseSensitive) ) {
|
||||
f7.dialog.alert(null, _t.textNoTextFound);
|
||||
}
|
||||
api.asc_findText(params.find, params.forward, params.caseSensitive, function(resultCount) {
|
||||
!resultCount && f7.dialog.alert(null, _t.textNoTextFound);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -566,15 +566,15 @@ define([
|
|||
options.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked);
|
||||
options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
||||
|
||||
if (!this.api.asc_findText(options)) {
|
||||
var me = this;
|
||||
Common.UI.info({
|
||||
msg: this.textNoTextFound,
|
||||
var me = this;
|
||||
this.api.asc_findText(options, function(resultCount) {
|
||||
!resultCount && Common.UI.info({
|
||||
msg: me.textNoTextFound,
|
||||
callback: function() {
|
||||
me.dlgSearch.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// }
|
||||
},
|
||||
|
||||
|
|
|
@ -165,9 +165,9 @@ const Search = withTranslation()(props => {
|
|||
|
||||
if (params.highlight) api.asc_selectSearchingResults(true);
|
||||
|
||||
if (!api.asc_findText(options)) {
|
||||
f7.dialog.alert(null, _t.textNoTextFound);
|
||||
}
|
||||
api.asc_findText(options, function(resultCount) {
|
||||
!resultCount && f7.dialog.alert(null, _t.textNoTextFound);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue