(js) Fix sorting after renaming an AddressBook
parent
41701cc94c
commit
6ce64a9a27
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
- [web] fixed confusion between owner and active user in ACLs management of Administration module
|
- [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)
|
3.2.4 (2016-12-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -583,10 +583,14 @@
|
||||||
* @returns a promise of the HTTP operation
|
* @returns a promise of the HTTP operation
|
||||||
*/
|
*/
|
||||||
AddressBook.prototype.$rename = function(name) {
|
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;
|
this.name = name;
|
||||||
AddressBook.$addressbooks.splice(i, 1);
|
list.splice(i, 1);
|
||||||
AddressBook.$add(this);
|
AddressBook.$add(this);
|
||||||
|
|
||||||
return this.$save();
|
return this.$save();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -848,7 +852,10 @@
|
||||||
var addressbook = {};
|
var addressbook = {};
|
||||||
angular.forEach(this, function(value, key) {
|
angular.forEach(this, function(value, key) {
|
||||||
if (key != 'constructor' &&
|
if (key != 'constructor' &&
|
||||||
|
key != 'acls' &&
|
||||||
key != 'ids' &&
|
key != 'ids' &&
|
||||||
|
key != 'idsMap' &&
|
||||||
|
key != 'urls' &&
|
||||||
key[0] != '$') {
|
key[0] != '$') {
|
||||||
addressbook[key] = value;
|
addressbook[key] = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue