mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 00:13:24 +00:00
(js) Improve handling of message flags
We now call the model's methods from the template. Uncluttered the message controller. Fixed the synchronization of the flags with the messages list.
This commit is contained in:
@@ -10,17 +10,6 @@
|
||||
function MessageController($scope, $rootScope, $stateParams, $state, stateAccount, stateMailbox, stateMessage, $timeout, encodeUriFilter, focus, Dialog, Account, Mailbox) {
|
||||
$rootScope.message = stateMessage;
|
||||
$scope.tags = {};
|
||||
$scope.addOrRemoveTag = function(operation, tag) {
|
||||
if (tag) {
|
||||
stateMessage.$addOrRemoveTag(operation, tag);
|
||||
}
|
||||
};
|
||||
$scope.markAsFlaggedOrUnflagged = function() {
|
||||
var operation = (stateMessage.isflagged ? 'remove' : 'add');
|
||||
stateMessage.$markAsFlaggedOrUnflagged(operation).then(function() {
|
||||
stateMessage.isflagged = !stateMessage.isflagged;
|
||||
});
|
||||
};
|
||||
$scope.doDelete = function() {
|
||||
stateMailbox.$deleteMessages([stateMessage.uid]).then(function() {
|
||||
// Remove message from list of messages
|
||||
|
||||
Reference in New Issue
Block a user