Only show up to 3 events in all-day row of week view, and link to day view, where...
authorJan Schneider <jan@horde.org>
Mon, 12 Apr 2010 14:28:12 +0000 (16:28 +0200)
committerJan Schneider <jan@horde.org>
Mon, 12 Apr 2010 14:28:26 +0000 (16:28 +0200)
kronolith/js/kronolith.js
kronolith/themes/screen.css

index c75f9d8..3b56d11 100644 (file)
@@ -1306,7 +1306,7 @@ KronolithCore = {
                         .select('.kronolithEvent')
                         .invoke('remove');
                     $('kronolithAllDay' + date)
-                        .select('.kronolithEvent')
+                        .childElements()
                         .invoke('remove');
                 }
                 break;
@@ -1516,7 +1516,15 @@ KronolithCore = {
                 if (view == 'day') {
                     $('kronolithViewDay').down('.kronolithAllDayContainer').insert(div.setStyle(style));
                 } else {
-                    $('kronolithAllDay' + date).insert(div.setStyle(style));
+                    var existing = $('kronolithAllDay' + date).select('div');
+                    if (existing.size() == 3) {
+                        if (existing[2].className != 'kronolithMore') {
+                            existing[2].remove();
+                            $('kronolithAllDay' + date).insert({ bottom: new Element('span', { className: 'kronolithMore' }).store('date', date).insert(Kronolith.text.more) });
+                        }
+                    } else {
+                        $('kronolithAllDay' + date).insert(div.setStyle(style));
+                    }
                 }
                 break;
             }
index 49aeca9..22ec406 100644 (file)
@@ -1371,6 +1371,13 @@ div.kronolithEvent {
     -webkit-border-radius: 4px;
     border-radius: 4px;
 }
+#kronolithViewDay .kronolithAllDay div.kronolithEvent,
+#kronolithViewWeek .kronolithAllDay div.kronolithEvent {
+    white-space: nowrap;
+}
+#kronolithViewDay .kronolithAllDay div.kronolithEvent {
+    float: left;
+}
 div.kronolithEvent .kronolithDragger {
     position: absolute;
     visibility: hidden;