1
0
Fork 0
forked from 0x2620/oxjs

make find work in listcalendar; fill first page in static text lists with few items; listen to width/height changes in listmap and listcalendar; fix a bug where maps would load without zoombar

This commit is contained in:
rlx 2011-10-11 09:09:20 +00:00
commit 9fb30bf1af
5 changed files with 55 additions and 34 deletions

View file

@ -578,24 +578,35 @@ Ox.ListCalendar = function(options, self) {
}
function updateList(key, value) {
var query = {
conditions: Ox.merge(
var events;
if (value === '') {
events = Ox.clone(self.options.events);
} else {
events = [];
self.options.events.forEach(function(event) {
if ((
['all', 'name'].indexOf(key) > -1
? [{key: 'name', value: value, operator: '='}] : [],
&& event.name.toLowerCase().indexOf(value) > -1
) || (
['all', 'alternativeNames'].indexOf(key) > -1
? [{key: 'alternativeNames', value: value, operator: '='}] : []
),
operator: key == 'all' ? '|' : '&'
};
self.$list.options({
items: function(data, callback) {
return pandora.api.findEvents(Ox.extend(data, {
query: query
}), callback);
}
});
&& event.alternativeNames.join('\n').toLowerCase().indexOf(value) > -1
)) {
events.push(event)
}
});
}
self.$list.options({items: events});
}
self.setOption = function(key, value) {
if (key == 'height') {
// fixme: should be .resizeList
self.$list.size();
} else if (key == 'width') {
self.$calendar.resizeCalendar();
}
};
return that;
};