From: Jan Schneider Date: Fri, 5 Jun 2009 16:42:42 +0000 (+0200) Subject: removeClassName() can become expensive too, as well as calling Date#toString() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3e761441ed7b20c3af6af99bf3cebcbefff7173f;p=horde.git removeClassName() can become expensive too, as well as calling Date#toString() on each sort step. --- diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index f4949d9b7..edc787162 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -876,6 +876,7 @@ KronolithCore = { if (view == 'year') { td = $('kronolithYearTable' + day.getMonth()).down('td[date=' + date + ']'); + td.className = ''; if (title) { td.writeAttribute('title', title).addClassName('kronolithHasEvents'); if (td.readAttribute('nicetitle')) { @@ -884,12 +885,7 @@ KronolithCore = { ToolTips.attach(td); if (busy) { td.addClassName('kronolithIsBusy'); - } else { - td.removeClassName('kronolithIsBusy'); } - } else { - td.removeClassName('kronolithHasEvents'); - td.removeClassName('kronolithIsBusy'); } } @@ -1323,6 +1319,8 @@ KronolithCore = { event.value.calendar = cal; event.value.start = Date.parse(event.value.s); event.value.end = Date.parse(event.value.e); + event.value.sort = event.value.start.toString('HHmmss') + + (240000 - parseInt(event.value.end.toString('HHmmss'))).toPaddedString(6); }); // Store events in cache. @@ -1383,8 +1381,7 @@ KronolithCore = { */ _sortEvents: function(event) { - return event.value.start.toString('HHmmss') - + (240000 - parseInt(event.value.end.toString('HHmmss'))).toPaddedString('0'); + return event.value.sort; }, _addHistory: function(loc, data)