mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-10 17:33:25 +00:00
(js) Improve addressbook renaming
The AddressBook instance to list the cards is now the same as the one from the list of addressbooks. Therefore, when renaming an addressbook, the addressbook name in the list is automatically updated.
This commit is contained in:
@@ -215,10 +215,12 @@
|
||||
* @desc Extend instance with new data and compute additional attributes.
|
||||
* @param {object} data - attributes of addressbook
|
||||
*/
|
||||
AddressBook.prototype.init = function(data) {
|
||||
this.$isLoading = true;
|
||||
this.$cards = [];
|
||||
this.cards = [];
|
||||
AddressBook.prototype.init = function(data, options) {
|
||||
if (!this.$cards) {
|
||||
this.$isLoading = true;
|
||||
this.$cards = [];
|
||||
this.cards = [];
|
||||
}
|
||||
angular.extend(this, data);
|
||||
// Add 'isOwned' and 'isSubscription' attributes based on active user (TODO: add it server-side?)
|
||||
this.isOwned = AddressBook.activeUser.isSuperUser || this.owner == AddressBook.activeUser.login;
|
||||
|
||||
Reference in New Issue
Block a user