From 32be98beb4f61574d61394b6d9c9b2f5eac39005 Mon Sep 17 00:00:00 2001
From: Michael M Slusarz
Date: Wed, 14 Oct 2009 09:43:15 -0600
Subject: [PATCH] Improvements/fixes to contacts popup
---
imp/js/contacts.js | 9 ++++++++-
imp/templates/contacts/contacts.html | 1 +
imp/templates/javascript_defs.php | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/imp/js/contacts.js b/imp/js/contacts.js
index 6170dfb25..f812012c8 100644
--- a/imp/js/contacts.js
+++ b/imp/js/contacts.js
@@ -62,7 +62,7 @@ var ImpContacts = {
updateMessage: function()
{
- if (parent.opener.closed) {
+ if (!parent.opener) {
alert(IMP.text.contacts_closed);
window.close();
return;
@@ -122,6 +122,9 @@ var ImpContacts = {
onDomLoad: function()
{
+ if ($('search').present()) {
+ $('btn_clear').show();
+ }
$('contacts').observe('submit', this._passAddresses.bind(this));
document.observe('change', this._changeHandler.bindAsEventListener(this));
document.observe('click', this._clickHandler.bindAsEventListener(this));
@@ -151,6 +154,10 @@ var ImpContacts = {
id = elt.readAttribute('id');
switch (id) {
+ case 'btn_clear':
+ $('search').setValue('');
+ break;
+
case 'btn_add_to':
case 'btn_add_cc':
case 'btn_add_bcc':
diff --git a/imp/templates/contacts/contacts.html b/imp/templates/contacts/contacts.html
index 15384d2a5..1e74a9e73 100644
--- a/imp/templates/contacts/contacts.html
+++ b/imp/templates/contacts/contacts.html
@@ -23,6 +23,7 @@
+
diff --git a/imp/templates/javascript_defs.php b/imp/templates/javascript_defs.php
index bc3c4343f..2dd3f64be 100644
--- a/imp/templates/javascript_defs.php
+++ b/imp/templates/javascript_defs.php
@@ -39,7 +39,7 @@ $code = array(
/* Strings used in contacts.js */
'contacts_select' => _("You must select an address first."),
- 'contacts_closed' => _("The message being composed has been closed. Exiting."),
+ 'contacts_closed' => _("The message being composed has been closed."),
'contacts_called' => _("This window must be called from a compose window."),
/* Strings used in folders.js */
--
2.11.0