This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user