This commit is contained in:
2019-07-04 18:17:34 +00:00
parent f55042fe05
commit 73dee0e8d1
3 changed files with 173 additions and 2 deletions

View File

@@ -101,6 +101,80 @@ app.mailEdit = (function() {
return false;
};
///////////////////////////////////
// MOVE TO SUB HANDLER
//
onMoveToSub = function(event) {
event.preventDefault();
$.gevent.publish("app-clear-error");
//is this a new record?
if (stateMap.id == "new") {
alert("New message MOVE handling makes no sense - figure it out!");
return false;
}
app.api.create(
"mail/movetosub/" +
stateMap.context.params.mail_account +
"/" +
stateMap.context.params.mail_id,
null,
function(res) {
if (res.error) {
$.gevent.publish("app-show-error", res.msg);
} else {
page("#!/inbox");
}
}
);
return false;
};
///////////////////////////////////
// MOVE TO SUB HANDLER
//
onMoveToNotSub = function(event) {
event.preventDefault();
$.gevent.publish("app-clear-error");
//is this a new record?
if (stateMap.id == "new") {
alert("New message MOVE handling makes no sense - figure it out!");
return false;
}
app.api.create(
"mail/movetonotsub/" +
stateMap.context.params.mail_account +
"/" +
stateMap.context.params.mail_id,
null,
function(res) {
if (res.error) {
$.gevent.publish("app-show-error", res.msg);
} else {
page("#!/inbox");
}
}
);
return false;
};
//new move routes:
//movetosub
//movetonotsub
//-------------------- END EVENT HANDLERS --------------------
//------------------- BEGIN PUBLIC METHODS -------------------
@@ -167,6 +241,13 @@ app.mailEdit = (function() {
//Context menu
app.nav.contextAddButton("btn-generate", "IsSpam", "axe", onSpam);
app.nav.contextAddButton("btn-generate", "IsSpam", "axe", onSpam);
//Move to subscribed or not subscribed
//id, title, icon, clickhandler
} else {
//NEW email options
var $group = $("#sendToGroup");