diff --git a/ChangeLog b/ChangeLog index 46a4bb136..4164f16ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-10-11 Wolfgang Sourdeau + * UI/WebServerResources/ContactsUI.js: + (onToolbarWriteToSelectedContacts): display an error message when + no contact is selected rather than composing a new message. Fixed + the method to only have one return point. + * UI/WebServerResources/generic.js: (triggerAjaxRequest): added an optional "attempt" argument that enables counting the number of invocations for an ajax request. diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index d47dc77eb..7a9f15395 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -414,16 +414,15 @@ function onToolbarWriteToSelectedContacts(event) { var rowsWithEmail = 0; if (rows.length == 0) { - openMailComposeWindow(ApplicationBaseURL + "Mail/compose"); - return false; + showAlertDialog(_("Please select a contact.")); + } + else { + openMailComposeWindow(ApplicationBaseURL + "../Mail/compose" + + "?folder=" + Contact.currentAddressBook.substring(1) + + "&uid=" + rows.join("&uid=")); + if (document.body.hasClassName("popup")) + window.close(); } - - openMailComposeWindow(ApplicationBaseURL + "../Mail/compose" - + "?folder=" + Contact.currentAddressBook.substring(1) - + "&uid=" + rows.join("&uid=")); - - if (document.body.hasClassName("popup")) - window.close(); return false; }