From: Jan Schneider Date: Thu, 18 Feb 2010 13:56:14 +0000 (+0100) Subject: Always open the first tab of an event/task dialog. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=109741c0a1ea6f101c7e6a1a91007fc70c5baf30;p=horde.git Always open the first tab of an event/task dialog. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index a9097c51b..f429c6e13 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -992,6 +992,26 @@ KronolithCore = { }, /** + * Opens a tab in a form. + * + * @param Element The A element of a tab. + */ + _openTab: function(elt) + { + var dialog = elt.up('form'); + dialog.select('.kronolithTabsOption').invoke('hide'); + dialog.select('.tabset li').invoke('removeClassName', 'activeTab'); + $(elt.id.replace(/Link/, 'Tab')).show(); + elt.parentNode.addClassName('activeTab'); + if (elt.id == 'kronolithEventLinkMap') { + /* Maps */ + if (!this.mapInitialized) { + this.initializeMap(); + } + } + }, + + /** * Sets the load signature and show the loading spinner. * * @param string resource The loading resource. @@ -1836,6 +1856,7 @@ KronolithCore = { RedBox.onDisplay = null; }; + this._openTab($('kronolithTaskForm').down('.tabset a.kronolithTabLink')); $('kronolithTaskForm').enable(); $('kronolithTaskForm').reset(); $('kronolithTaskSave').show(); @@ -2825,17 +2846,7 @@ KronolithCore = { return; case 'kronolithTabLink': - var dialog = elt.up('form'); - dialog.select('.kronolithTabsOption').invoke('hide'); - dialog.select('.tabset li').invoke('removeClassName', 'activeTab'); - $(id.replace(/Link/, 'Tab')).show(); - elt.parentNode.addClassName('activeTab'); - if (id == 'kronolithEventLinkMap') { - /* Maps */ - if (!this.mapInitialized) { - this.initializeMap(); - } - } + this._openTab(elt); e.stop(); return; @@ -3277,6 +3288,7 @@ KronolithCore = { this.updateCalendarDropDown('kronolithEventTarget'); this.toggleAllDay(false); + this._openTab($('kronolithEventForm').down('.tabset a.kronolithTabLink')); $('kronolithEventForm').enable(); $('kronolithEventForm').reset(); if (Kronolith.conf.maps.driver) {