From 41aba43200ad59cf16e7a032448d7d68e85b5921 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 30 Oct 2009 14:43:36 +0000 Subject: [PATCH] See ChangeLog Fix for bug #212 Monotone-Parent: 4e15640eabc9053b15d1d41557d0a3d2e9ddd1ec Monotone-Revision: f9a5012ee107f7a23f74fa23e06ce8a63fcab7eb Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-10-30T14:43:36 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++ UI/WebServerResources/UIxComponentEditor.js | 48 +++++++++++++++++---- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index eec8cd68e..94b3d9432 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-30 Francis Lachapelle + + * UI/WebServerResources/UIxComponentEditor.js + (onComponentEditorClose): new method that closes definition popup + windows associated to the event (attendees/recurrence/reminder). + 2009-10-28 Francis Lachapelle * UI/Contacts/UIxContactView.m (-primaryEmail, -secondaryEmail): diff --git a/UI/WebServerResources/UIxComponentEditor.js b/UI/WebServerResources/UIxComponentEditor.js index e7b490c90..2bace05c0 100644 --- a/UI/WebServerResources/UIxComponentEditor.js +++ b/UI/WebServerResources/UIxComponentEditor.js @@ -1,11 +1,21 @@ /* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +var ComponentEditor = { + attendeesWindow: null, + recurrenceWindow: null, + reminderWindow: null +}; + function onPopupAttendeesWindow(event) { if (event) preventDefault(event); - window.open(ApplicationBaseURL + "/editAttendees", null, - "width=803,height=573"); - + if (ComponentEditor.attendeesWindow && ComponentEditor.attendeesWindow.open && !ComponentEditor.attendeesWindow.closed) + ComponentEditor.attendeesWindow.focus(); + else + ComponentEditor.attendeesWindow = window.open(ApplicationBaseURL + "/editAttendees", + sanitizeWindowName(activeCalendar + activeComponent + "Attendees"), + "width=803,height=573"); + return false; } @@ -165,6 +175,7 @@ function onComponentEditorLoad(event) { tmp.observe("keyup", onSummaryChange); Event.observe(window, "resize", onWindowResize); + Event.observe(window, "beforeunload", onComponentEditorClose); onPopupRecurrenceWindow(null); onPopupReminderWindow(null); @@ -207,6 +218,15 @@ function onReplyChange(event) { return true; } +function onComponentEditorClose(event) { + if (ComponentEditor.attendeesWindow && ComponentEditor.attendeesWindow.open && !ComponentEditor.attendeesWindow.closed) + ComponentEditor.attendeesWindow.close(); + if (ComponentEditor.recurrenceWindow && ComponentEditor.recurrenceWindow.open && !ComponentEditor.recurrenceWindow.closed) + ComponentEditor.recurrenceWindow.close(); + if (ComponentEditor.reminderWindow && ComponentEditor.reminderWindow.open && !ComponentEditor.reminderWindow.closed) + ComponentEditor.reminderWindow.close(); +} + function onWindowResize(event) { var comment = $("commentArea"); if (comment) { @@ -262,9 +282,14 @@ function onPopupRecurrenceWindow(event) { if (repeatList && repeatList.value == 7) { // Custom repeat rule repeatHref.show(); - if (event) - window.open(ApplicationBaseURL + "editRecurrence", null, - "width=500,height=400"); + if (event) { + if (ComponentEditor.recurrenceWindow && ComponentEditor.recurrenceWindow.open && !ComponentEditor.recurrenceWindow.closed) + ComponentEditor.recurrenceWindow.focus(); + else + ComponentEditor.recurrenceWindow = window.open(ApplicationBaseURL + "editRecurrence", + sanitizeWindowName(activeCalendar + activeComponent + "Recurrence"), + "width=500,height=400"); + } } else if (repeatHref) repeatHref.hide(); @@ -281,9 +306,14 @@ function onPopupReminderWindow(event) { var reminderList = $("reminderList"); if (reminderList && reminderList.value == 15) { reminderHref.show(); - if (event) - window.open(ApplicationBaseURL + "editReminder", null, - "width=250,height=150"); + if (event) { + if (ComponentEditor.reminderWindow && ComponentEditor.reminderWindow.open && !ComponentEditor.reminderWindow.closed) + ComponentEditor.reminderWindow.focus(); + else + ComponentEditor.reminderWindow = window.open(ApplicationBaseURL + "editReminder", + sanitizeWindowName(activeCalendar + activeComponent + "Reminder"), + "width=250,height=150"); + } } else if (reminderHref) reminderHref.hide();