Mail Editor: prohibit double-click on send button

Added a "safety net" like when loading a page (UIxPageFrame) to avoid
double-clicking on the send button.
This commit is contained in:
Francis Lachapelle
2012-09-18 15:05:02 -04:00
parent 56a9692da4
commit 802f081f28

View File

@@ -123,6 +123,10 @@ function onValidate(onSuccess) {
}
function onValidateDone(onSuccess) {
// Create "blocking" div to avoid double-clicking on send button
var safetyNet = createElement("div", "javascriptSafetyNet");
$('pageContent').insert({top: safetyNet});
var input = currentAttachmentInput();
if (input)
input.parentNode.removeChild(input);
@@ -137,7 +141,7 @@ function onValidateDone(onSuccess) {
window.shouldPreserve = true;
document.pageform.action = "send";
AIM.submit($(document.pageform), {'onComplete' : onPostComplete});
if (typeof onSuccess == 'function')
@@ -159,7 +163,7 @@ function onPostComplete(response) {
p = window.opener;
if (p && p.refreshMessage)
p.refreshMessage(jsonResponse["sourceFolder"],
jsonResponse["messageID"]);
jsonResponse["messageID"]);
onCloseButtonClick();
}
else {
@@ -170,6 +174,8 @@ function onPostComplete(response) {
progressImage.parentNode.removeChild(progressImage);
}
showAlertDialog(jsonResponse["message"]);
// Remove "blocking" div
onFinalLoadHandler(); // from generic.js
}
}
else {