mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-12 11:55:09 +00:00
(js) Move Settings to a value in Common ng module
Also removed explicit settings and defaults that were imported in various app modules. We now always use the Preferences ng service.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
$q: $q,
|
||||
$timeout: $timeout,
|
||||
$log: $log,
|
||||
$$resource: new Resource(Settings.activeUser.folderURL + 'Contacts', Settings.activeUser),
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Contacts', Settings.activeUser()),
|
||||
$Card: Card,
|
||||
$$Acl: Acl,
|
||||
$Preferences: Preferences,
|
||||
|
||||
@@ -38,12 +38,17 @@
|
||||
* @desc The factory we'll use to register with Angular.
|
||||
* @returns the Card constructor
|
||||
*/
|
||||
Card.$factory = ['$timeout', 'sgSettings', 'Resource', 'Gravatar', function($timeout, Settings, Resource, Gravatar) {
|
||||
Card.$factory = ['$timeout', 'sgSettings', 'Resource', 'Preferences', 'Gravatar', function($timeout, Settings, Resource, Preferences, Gravatar) {
|
||||
angular.extend(Card, {
|
||||
$$resource: new Resource(Settings.activeUser.folderURL + 'Contacts', Settings.activeUser),
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Contacts', Settings.activeUser()),
|
||||
$timeout: $timeout,
|
||||
$gravatar: Gravatar,
|
||||
$categories: window.UserDefaults.SOGoContactsCategories
|
||||
$gravatar: Gravatar
|
||||
});
|
||||
// Initialize categories from user's defaults
|
||||
Preferences.ready().then(function() {
|
||||
if (Preferences.defaults.SOGoContactsCategories) {
|
||||
Card.$categories = Preferences.defaults.SOGoContactsCategories;
|
||||
}
|
||||
});
|
||||
|
||||
return Card; // return constructor
|
||||
|
||||
Reference in New Issue
Block a user