Show 'no items' notice if a calendar section is empty.
authorJan Schneider <jan@horde.org>
Fri, 9 Apr 2010 15:49:38 +0000 (16:49 +0100)
committerJan Schneider <jan@horde.org>
Fri, 9 Apr 2010 16:14:21 +0000 (18:14 +0200)
kronolith/js/kronolith.js
kronolith/templates/index/index.inc

index 3d706f3..7bf4aa3 100644 (file)
@@ -917,9 +917,16 @@ KronolithCore = {
      */
     insertCalendarInList: function(type, id, cal, div)
     {
+        var noItems;
         if (!div) {
             div = this.getCalendarList(type, cal.owner);
         }
+        noItems = div.previous();
+        if (noItems &&
+            noItems.tagName == 'DIV' &&
+            noItems.className == 'kronolithDialogInfo') {
+            noItems.hide();
+        }
         if (type != 'holiday' && type != 'external') {
             div.insert(new Element('span', { className: 'kronolithCalEdit' })
                    .insert('&#9656;'));
index 8dba54e..940b15a 100644 (file)
     <span><?php echo _("Shared Calendars") ?></span>
   </h3>
 
+  <div class="kronolithDialogInfo"><?php echo _("No items to display") ?></div>
   <div id="kronolithSharedCalendars" class="kronolithCalendars" style="display:none">
   </div>
 
     <span><?php echo _("Shared Task Lists") ?></span>
   </h3>
 
+  <div class="kronolithDialogInfo"><?php echo _("No items to display") ?></div>
   <div id="kronolithSharedTasklists" class="kronolithCalendars" style="display:none">
   </div>
   <?php endif; ?>
     <span><?php echo _("Remote Calendars") ?></span>
   </h3>
 
+  <div class="kronolithDialogInfo"><?php echo _("No items to display") ?></div>
   <div id="kronolithRemoteCalendars" class="kronolithCalendars" style="display:none">
   </div>