Fix error if the form doesn't have tabs.
authorJan Schneider <jan@horde.org>
Mon, 22 Feb 2010 21:25:37 +0000 (22:25 +0100)
committerJan Schneider <jan@horde.org>
Mon, 22 Feb 2010 21:27:54 +0000 (22:27 +0100)
kronolith/js/kronolith.js

index aceb818..f8c87e4 100644 (file)
@@ -2070,7 +2070,10 @@ KronolithCore = {
         var type = calendar[0];
         calendar = calendar.length == 1 ? null : calendar[1];
 
-        this.openTab($('kronolithCalendarForm' + type).down('.tabset a.kronolithTabLink'));
+        var firstTab = $('kronolithCalendarForm' + type).down('.tabset a.kronolithTabLink');
+        if (firstTab) {
+            this.openTab(firstTab);
+        }
         $('kronolithCalendarDialog').select('.kronolithCalendarDiv').invoke('hide');
         $('kronolithCalendar' + type + '1').show();
         $('kronolithCalendarForm' + type).select('.kronolithCalendarContinue').invoke('enable');