From eb58676dd680a4c13df44e68ae04c22821555b8e Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 21 Mar 2012 05:16:13 +0000 Subject: [PATCH] disable send button during send, fixes #694 --- static/js/pandora/usersDialog.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/static/js/pandora/usersDialog.js b/static/js/pandora/usersDialog.js index 45f91f9e..db945138 100644 --- a/static/js/pandora/usersDialog.js +++ b/static/js/pandora/usersDialog.js @@ -323,6 +323,16 @@ pandora.ui.usersDialog = function() { $editForm, + $sendButton = Ox.Button({ + disabled: true, + id: 'send', + title: 'Send', + width: 64 + }) + .bindEvent({ + click: sendMail + }), + $mailForm = renderMailForm(), $content = Ox.SplitPanel({ @@ -685,15 +695,7 @@ pandora.ui.usersDialog = function() { value: false, width: formWidth - 16 }), - Ox.Button({ - disabled: true, - id: 'send', - title: 'Send', - width: 64 - }) - .bindEvent({ - click: sendMail - }) + $sendButton ], width: formWidth - 16 }) @@ -736,6 +738,7 @@ pandora.ui.usersDialog = function() { } function sendMail() { + $sendButton.options({title: 'Sending', disabled: true}); pandora.api.mail({ to: getTo(), subject: getFormItemById('subject').value(), @@ -778,6 +781,7 @@ pandora.ui.usersDialog = function() { title: title, width: 304 }).open(); + $sendButton.options({title: 'Send', disabled: false}); }); }