Merge pull request #2023 from ONLYOFFICE/feature/search-in-menu
Feature/search in menu
This commit is contained in:
commit
3ab4211953
|
@ -407,8 +407,9 @@ define([
|
|||
},
|
||||
|
||||
selectCandidate: function() {
|
||||
var index = this._search.index || 0,
|
||||
var index = (this._search.index && this._search.index != -1) ? this._search.index : 0,
|
||||
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
|
||||
isFirstCharsEqual = re.test(this.store.at(index).get(this.displayField)),
|
||||
itemCandidate, idxCandidate;
|
||||
|
||||
for (var i=0; i<this.store.length; i++) {
|
||||
|
@ -417,6 +418,8 @@ define([
|
|||
if (!itemCandidate) {
|
||||
itemCandidate = item;
|
||||
idxCandidate = i;
|
||||
if(!isFirstCharsEqual)
|
||||
break;
|
||||
}
|
||||
if (this._search.full && i==index || i>index) {
|
||||
itemCandidate = item;
|
||||
|
|
|
@ -472,8 +472,9 @@ define([
|
|||
},
|
||||
|
||||
selectCandidate: function() {
|
||||
var index = this._search.index || 0,
|
||||
var index = (this._search.index && this._search.index != -1) ? this._search.index : 0,
|
||||
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
|
||||
isFirstCharsEqual = re.test(this.items[index].caption),
|
||||
itemCandidate, idxCandidate;
|
||||
|
||||
for (var i=0; i<this.items.length; i++) {
|
||||
|
@ -482,6 +483,8 @@ define([
|
|||
if (!itemCandidate) {
|
||||
itemCandidate = item;
|
||||
idxCandidate = i;
|
||||
if(!isFirstCharsEqual)
|
||||
break;
|
||||
}
|
||||
if (this._search.full && i==index || i>index) {
|
||||
itemCandidate = item;
|
||||
|
@ -1051,8 +1054,9 @@ define([
|
|||
},
|
||||
|
||||
selectCandidate: function() {
|
||||
var index = this._search.index || 0,
|
||||
var index = (this._search.index && this._search.index != -1) ? this._search.index : 0,
|
||||
re = new RegExp('^' + ((this._search.full) ? this._search.text : this._search.char), 'i'),
|
||||
isFirstCharsEqual = re.test(this.items[index].caption),
|
||||
itemCandidate, idxCandidate;
|
||||
|
||||
for (var i=0; i<this.items.length; i++) {
|
||||
|
@ -1061,6 +1065,8 @@ define([
|
|||
if (!itemCandidate) {
|
||||
itemCandidate = item;
|
||||
idxCandidate = i;
|
||||
if(!isFirstCharsEqual)
|
||||
break;
|
||||
}
|
||||
if (this._search.full && i==index || i>index) {
|
||||
itemCandidate = item;
|
||||
|
|
Loading…
Reference in a new issue