Focus first field of calendar dialog.
authorJan Schneider <jan@horde.org>
Mon, 17 May 2010 22:08:13 +0000 (00:08 +0200)
committerJan Schneider <jan@horde.org>
Mon, 17 May 2010 23:35:44 +0000 (01:35 +0200)
kronolith/js/kronolith.js

index 3b970a6..52beeff 100644 (file)
@@ -2446,6 +2446,18 @@ KronolithCore = {
 
         this.closeRedBox();
         this.quickClose();
+
+        this.redBoxOnDisplay = RedBox.onDisplay;
+        RedBox.onDisplay = function() {
+            if (this.redBoxOnDisplay) {
+                this.redBoxOnDisplay();
+            }
+            try {
+                $('kronolithCalendarForm' + calendar.split('|')[0]).focusFirstElement();
+            } catch(e) {}
+            RedBox.onDisplay = this.redBoxOnDisplay;
+        }.bind(this);
+
         if ($('kronolithCalendarDialog')) {
             this.redBoxLoading = true;
             RedBox.showHtml($('kronolithCalendarDialog').show());
@@ -4363,10 +4375,10 @@ KronolithCore = {
         this.quickClose();
         this.redBoxOnDisplay = RedBox.onDisplay;
         RedBox.onDisplay = function() {
-           if (this.redBoxOnDisplay) {
-               this.redBoxOnDisplay();
-           }
-           try {
+            if (this.redBoxOnDisplay) {
+                this.redBoxOnDisplay();
+            }
+            try {
                 $('kronolithEventForm').focusFirstElement();
             } catch(e) {}
             if (Kronolith.conf.maps.driver &&