1
0
Fork 0
forked from 0x2620/oxjs

slightly faster text list construction for cells that don't have tooltips; make calendar layout deterministic for events that have the same time span

This commit is contained in:
rlx 2011-10-11 06:32:20 +00:00
commit 527f75b009
4 changed files with 44 additions and 26 deletions

View file

@ -479,7 +479,9 @@ Ox.ListCalendar = function(options, self) {
self.options.addEvent(event, function(result) {
event.id = result.data.id;
self.options.events.push(event);
var time0 = +new Date()
self.$list.options({items: Ox.clone(self.options.events, true)});
Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0);
self.$calendar.addEvent(event);
selectEvent(event);
});
@ -491,7 +493,9 @@ Ox.ListCalendar = function(options, self) {
data = {id: id};
self.options.events[index][key] = value;
data[key] = value;
var time0 = +new Date();
self.$list.options({items: Ox.clone(self.options.events, true)});
Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0);
if (['name', 'type', 'start', 'end'].indexOf(key) > -1) {
self.$calendar.editEvent(id, key, value);
}
@ -507,11 +511,9 @@ Ox.ListCalendar = function(options, self) {
)
});
}
self.options.editEvent(data, function(result) {
// ...
});
}
function initList(data) {
@ -545,7 +547,9 @@ Ox.ListCalendar = function(options, self) {
var id = self.selectedEvent,
index = Ox.getPositionById(self.options.events, id);
self.options.events.splice(index, 1);
var time0 = +new Date();
self.$list.options({items: Ox.clone(self.options.events, true)});
Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0);
self.$calendar.removeEvent();
selectEvent({});
self.options.removeEvent({id: id}, function(result) {