mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-14 12:20:24 +08:00
small performance-fix for minute-scaled slots
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user