There was a conflict between confirmation messages.

fixed #167
This commit is contained in:
Antoine Nguyen
2011-09-13 17:46:57 +02:00
parent 7a867eee9d
commit 0b0107722f
2 changed files with 20 additions and 7 deletions
@@ -30,13 +30,28 @@ function actioncallback(resp) {
}
function actionclick(evt) {
evt.stop();
new Request.JSON({
url: evt.target.get("href"),
onSuccess: actioncallback
}).get();
}
function deleteclick(evt) {
evt.stop();
if (!confirm(gettext("Delete this message?"))) {
return false;
}
actionclick(evt);
}
function releaseclick(evt) {
evt.stop();
if (!confirm(gettext("Release this message?"))) {
return false;
}
actionclick(evt);
}
function viewmail_cs(evt) {
evt.stop();
var to = this.getFirst("td[name=to]");
@@ -114,8 +129,8 @@ function listing_cb(resp) {
function viewmail_cb(resp) {
updatelisting(resp);
$$("a[name=back]").addEvent("click", updatehash);
$$("a[name=delete]").addEvent("click", actionclick);
$$("a[name=release]").addEvent("click", actionclick);
$$("a[name=delete]").addEvent("click", deleteclick);
$$("a[name=release]").addEvent("click", releaseclick);
$$("a[name=viewmode]").addEvent("click", updateparams);
setDivHeight("mailcontent", 5, 0);
}
@@ -38,14 +38,12 @@ def viewm_menu(selection, backurl, mail_id, rcpt, perms):
"url" : reverse(amavis_quarantine.views.release, args=[mail_id]) \
+ "?rcpt=%s" % rcpt,
"img" : static_url("pics/release.png"),
"label" : _("Release"),
"confirm" : _("Release this message?")},
"label" : _("Release")},
{"name" : "delete",
"url" : reverse(amavis_quarantine.views.delete, args=[mail_id]) \
+ "?rcpt=%s" % rcpt,
"img" : static_url("pics/remove.png"),
"label" : _("Delete"),
"confirm" : _("Delete this message?")},
"label" : _("Delete")},
{"name" : "options",
"label" : _("Options"),
"img" : static_url("pics/settings.png"),