From: Jan Schneider Date: Tue, 2 Mar 2010 22:57:23 +0000 (+0100) Subject: Close exiting dialog before opening a new one. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=76f9e8fe6d1f74cae76cf7d183a327517a034249;p=horde.git Close exiting dialog before opening a new one. --- diff --git a/horde/js/redbox.js b/horde/js/redbox.js index d92f52a67..bfc85965c 100644 --- a/horde/js/redbox.js +++ b/horde/js/redbox.js @@ -119,6 +119,11 @@ var RedBox = { this.setWindowPosition(); }, + getWindow: function() + { + return $('RB_window'); + }, + getWindowContents: function() { var w = $('RB_window'); diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 8da220840..99f5bab3f 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1880,6 +1880,8 @@ KronolithCore = { editTask: function(tasklist, id) { + this.closeRedBox(); + RedBox.onDisplay = function() { try { $('kronolithTaskForm').focusFirstElement(); @@ -2056,6 +2058,8 @@ KronolithCore = { */ editCalendar: function(calendar) { + this.closeRedBox(); + if ($('kronolithCalendarDialog')) { RedBox.showHtml($('kronolithCalendarDialog').show()); this.editCalendarCallback(calendar); @@ -3366,6 +3370,8 @@ KronolithCore = { editEvent: function(calendar, id, date) { + this.closeRedBox(); + if (Object.isUndefined($('kronolithEventTags').autocompleter)) { this.editEvent.bind(this, calendar, id, date).defer(); return; @@ -3809,6 +3815,9 @@ KronolithCore = { closeRedBox: function() { + if (!RedBox.getWindow()) { + return; + } var content = RedBox.getWindowContents(); if (content) { document.body.insert(content.hide());