small performance-fix for minute-scaled slots

This commit is contained in:
Clemens
2013-08-03 16:35:55 -07:00
committed by Adam Shaw
parent 664ec8f730
commit 6da36c7bdf
+5 -1
View File
@@ -722,7 +722,11 @@ function AgendaView(element, calendar, viewName) {
slotI = Math.floor(minutes / slotMinutes),
slotTop = slotTopCache[slotI];
if (slotTop === undefined) {
slotTop = slotTopCache[slotI] = slotTable.find('tr:eq(' + slotI + ') td div')[0].offsetTop; //.position().top; // need this optimization???
slotTop = slotTopCache[slotI] =
slotTable.find('tr').eq(slotI).find('td div')[0].offsetTop;
// .eq() is faster than ":eq()" selector
// [0].offsetTop is faster than .position().top (do we really need this optimization?)
// a better optimization would be to cache all these divs
}
return Math.max(0, Math.round(
slotTop - 1 + slotHeight * ((minutes % slotMinutes) / slotMinutes)