mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-12 20:05:08 +00:00
Expose user's settings and defaults inline
This improves performance by removing two AJAX calls and a lot of JavaScript promises.
This commit is contained in:
@@ -23,23 +23,23 @@
|
||||
vm.changeView = changeView;
|
||||
|
||||
|
||||
_registerHotkeys(hotkeys);
|
||||
this.$onInit = function() {
|
||||
_registerHotkeys(hotkeys);
|
||||
|
||||
Preferences.ready().then(function() {
|
||||
_formatDate(vm.selectedDate);
|
||||
});
|
||||
|
||||
// Refresh current view when the list of calendars is modified
|
||||
deregisterCalendarsList = $rootScope.$on('calendars:list', updateView);
|
||||
// Refresh current view when the list of calendars is modified
|
||||
deregisterCalendarsList = $rootScope.$on('calendars:list', updateView);
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
// Destroy event listener when the controller is being deactivated
|
||||
deregisterCalendarsList();
|
||||
// Deregister hotkeys
|
||||
_.forEach(hotkeys, function(key) {
|
||||
sgHotkeys.deregisterHotkey(key);
|
||||
$scope.$on('$destroy', function() {
|
||||
// Destroy event listener when the controller is being deactivated
|
||||
deregisterCalendarsList();
|
||||
// Deregister hotkeys
|
||||
_.forEach(hotkeys, function(key) {
|
||||
sgHotkeys.deregisterHotkey(key);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function _registerHotkeys(keys) {
|
||||
|
||||
Reference in New Issue
Block a user