mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-06 17:29:22 +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:
1 parent
ec123b4512
commit
a9ad21b395
5 files changed
+60
-31
No files matched your search
@@ -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