(js) Restore user's last Calendar view

Also reviewed the handling of Angular modules dependencies.
This commit is contained in:
Francis Lachapelle
2015-07-29 11:47:01 -04:00
parent 762f305914
commit 7e10cff395
16 changed files with 101 additions and 65 deletions
@@ -47,7 +47,16 @@
return AddressBook; // return constructor
}];
/* Factory registration in Angular module */
/**
* @module SOGo.ContactsUI
* @desc Factory registration of AddressBook in Angular module.
*/
try {
angular.module('SOGo.ContactsUI');
}
catch(e) {
angular.module('SOGo.ContactsUI', ['SOGo.Common']);
}
angular.module('SOGo.ContactsUI')
.factory('AddressBook', AddressBook.$factory);
@@ -53,6 +53,12 @@
* @module SOGo.ContactsUI
* @desc Factory registration of Card in Angular module.
*/
try {
angular.module('SOGo.ContactsUI');
}
catch(e) {
angular.module('SOGo.ContactsUI', ['SOGo.Common']);
}
angular.module('SOGo.ContactsUI')
.factory('Card', Card.$factory);
@@ -403,15 +409,15 @@
* @param {string} email
* @param {Card} card
*/
Card.prototype.$updateMember = function(index, email, card) {
var ref = {
email: email,
emails: [{value: email}],
reference: card.c_name,
c_cn: card.$fullname()
};
this.refs[index] = new Card(ref);
};
// Card.prototype.$updateMember = function(index, email, card) {
// var ref = {
// email: email,
// emails: [{value: email}],
// reference: card.c_name,
// c_cn: card.$fullname()
// };
// this.refs[index] = new Card(ref);
// };
/**
* @function $unwrap