1
0
Fork 0
forked from 0x2620/oxjs

make map zoom work while list has focus

This commit is contained in:
rolux 2011-05-24 16:32:03 +02:00
commit 74802d284a
5 changed files with 19 additions and 3 deletions

View file

@ -1282,7 +1282,7 @@ Ox.List = function(options, self) {
} else if (key == 'selected') {
Ox.print('setOption selected', value)
setSelected(value);
triggerSelectEvent();
triggerSelectEvent(); // fixme: added to make text list find-as-you-type work, may break other things
} else if (key == 'sort') {
Ox.print('---sort---')
updateSort();

View file

@ -485,12 +485,14 @@ Ox.TextList = function(options, self) {
// fixme: works only if items are an array
var query = data.keys,
sort = self.options.sort[0];
Ox.print('QUERY', query)
Ox.forEach(self.options.items, function(item, i) {
var value = (
sort.map ? sort.map(item[sort.key]) : item[sort.key]
).toLowerCase();
if (Ox.startsWith(value, query)) {
that.$body.options({selected: [item[self.unique]]});
Ox.print('QUERY', query, 'VALUE', value)
return false;
}
});