mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-19 07:04:53 +00:00
(js) Fix selected message class in advanced search
Also improved display of accounts subheaders.
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
/**
|
||||
* @function init
|
||||
* @memberof Mailbox.prototype
|
||||
* @memberof VirtualMailbox.prototype
|
||||
* @desc Extend instance with new data and compute additional attributes.
|
||||
* @param {object} data - attributes of mailbox
|
||||
*/
|
||||
@@ -103,9 +103,34 @@
|
||||
this.$isLoading = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function resetSelectedMessage
|
||||
* @memberof VirtualMailbox.prototype
|
||||
* @desc Delete 'selectedMessage' attribute of all submailboxes.
|
||||
*/
|
||||
VirtualMailbox.prototype.resetSelectedMessage = function() {
|
||||
_.each(this.$mailboxes, function(mailbox) {
|
||||
delete mailbox.selectedMessage;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function isSelectedMessage
|
||||
* @memberof VirtualMailbox.prototype
|
||||
* @desc Check if the message of the specified mailbox is selected.
|
||||
* @param {string} messageId
|
||||
* @param {string} mailboxPath
|
||||
* @returns true if the specified message is selected
|
||||
*/
|
||||
VirtualMailbox.prototype.isSelectedMessage = function(messageId, mailboxPath) {
|
||||
return angular.isDefined(_.find(this.$mailboxes, function(mailbox) {
|
||||
return mailbox.path == mailboxPath && mailbox.selectedMessage == messageId;
|
||||
}));
|
||||
};
|
||||
|
||||
/**
|
||||
* @function getLength
|
||||
* @memberof Mailbox.prototype
|
||||
* @memberof VirtualMailbox.prototype
|
||||
* @desc Used by md-virtual-repeat / md-on-demand
|
||||
* @returns the number of items in the mailbox
|
||||
*/
|
||||
@@ -124,7 +149,7 @@
|
||||
|
||||
/**
|
||||
* @function getItemAtIndex
|
||||
* @memberof Mailbox.prototype
|
||||
* @memberof VirtualMailbox.prototype
|
||||
* @desc Used by md-virtual-repeat / md-on-demand
|
||||
* @returns the message as the specified index
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user