mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-12 11:55:09 +00:00
(js) Fix sorting after renaming an AddressBook
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
Bug fixes
|
||||
- [web] fixed confusion between owner and active user in ACLs management of Administration module
|
||||
- [web] fixed JavaScript exception after renaming an address book
|
||||
|
||||
3.2.4 (2016-12-01)
|
||||
------------------
|
||||
|
||||
@@ -583,10 +583,14 @@
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
AddressBook.prototype.$rename = function(name) {
|
||||
var i = _.indexOf(_.map(AddressBook.$addressbooks, 'id'), this.id);
|
||||
var i, list;
|
||||
|
||||
list = this.isSubscription? AddressBook.$subscriptions : AddressBook.$addressbooks;
|
||||
i = _.indexOf(_.map(list, 'id'), this.id);
|
||||
this.name = name;
|
||||
AddressBook.$addressbooks.splice(i, 1);
|
||||
list.splice(i, 1);
|
||||
AddressBook.$add(this);
|
||||
|
||||
return this.$save();
|
||||
};
|
||||
|
||||
@@ -848,7 +852,10 @@
|
||||
var addressbook = {};
|
||||
angular.forEach(this, function(value, key) {
|
||||
if (key != 'constructor' &&
|
||||
key != 'acls' &&
|
||||
key != 'ids' &&
|
||||
key != 'idsMap' &&
|
||||
key != 'urls' &&
|
||||
key[0] != '$') {
|
||||
addressbook[key] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user