From 6ea8efe47f818b5367284bccb0f8defabb798c61 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 18 May 2010 00:08:13 +0200 Subject: [PATCH] Focus first field of calendar dialog. --- kronolith/js/kronolith.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 3b970a6fd..52beeff8c 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -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 && -- 2.11.0