From: Jan Schneider Date: Mon, 17 May 2010 22:08:13 +0000 (+0200) Subject: Focus first field of calendar dialog. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6ea8efe47f818b5367284bccb0f8defabb798c61;p=horde.git Focus first field of calendar dialog. --- 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 &&