Only hide those DIVs if they aren't visible yet. IE loses focus on input fields
authorJan Schneider <jan@horde.org>
Thu, 27 Jan 2011 17:24:03 +0000 (18:24 +0100)
committerJan Schneider <jan@horde.org>
Thu, 27 Jan 2011 17:38:40 +0000 (18:38 +0100)
if you hide the surrounding DIV.

kronolith/js/kronolith.js

index a5c243b..d5b74e8 100644 (file)
@@ -5430,18 +5430,20 @@ KronolithCore = {
      */
     toggleRecurrence: function(recur)
     {
-        if (recur != 'Length') {
-            $('kronolithEventTabRecur').select('div').invoke('hide');
-        }
-
         if (recur == 'Exception') {
-            $('kronolithEventRepeatException').show();
+            if (!$('kronolithEventRepeatException').visible()) {
+                $('kronolithEventTabRecur').select('div').invoke('hide');
+                $('kronolithEventRepeatException').show();
+            }
         } else if (recur != 'None') {
             var div = $('kronolithEventRepeat' + recur),
                 length = $('kronolithEventRepeatLength');
-            div.show();
-            length.show();
-            $('kronolithEventRepeatType').show();
+            if (!div.visible()) {
+                $('kronolithEventTabRecur').select('div').invoke('hide');
+                div.show();
+                length.show();
+                $('kronolithEventRepeatType').show();
+            }
             switch (recur) {
             case 'Daily':
             case 'Weekly':
@@ -5469,7 +5471,10 @@ KronolithCore = {
                 $('kronolithEventRecurCount').disable();
             }
         } else {
-            $('kronolithEventRepeatType').show();
+            if (!$('kronolithEventRepeatType').visible()) {
+                $('kronolithEventTabRecur').select('div').invoke('hide');
+                $('kronolithEventRepeatType').show();
+            }
         }
     },