mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-22 11:55:24 +00:00
(js) Ask to reload the page when changing language
This commit is contained in:
@@ -7,14 +7,15 @@
|
||||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
PreferencesController.$inject = ['$state', '$mdDialog', '$mdToast', 'Dialog', 'User', 'Account', 'statePreferences', 'Authentication'];
|
||||
function PreferencesController($state, $mdDialog, $mdToast, Dialog, User, Account, statePreferences, Authentication) {
|
||||
PreferencesController.$inject = ['$q', '$window', '$state', '$mdDialog', '$mdToast', 'Dialog', 'User', 'Account', 'statePreferences', 'Authentication'];
|
||||
function PreferencesController($q, $window, $state, $mdDialog, $mdToast, Dialog, User, Account, statePreferences, Authentication) {
|
||||
var vm = this, account, mailboxes = [];
|
||||
|
||||
vm.preferences = statePreferences;
|
||||
vm.passwords = { newPassword: null, newPasswordConfirmation: null };
|
||||
|
||||
vm.go = go;
|
||||
vm.onLanguageChange = onLanguageChange;
|
||||
vm.addCalendarCategory = addCalendarCategory;
|
||||
vm.removeCalendarCategory = removeCalendarCategory;
|
||||
vm.addContactCategory = addContactCategory;
|
||||
@@ -52,6 +53,17 @@
|
||||
$state.go('preferences.' + module);
|
||||
}
|
||||
|
||||
function onLanguageChange() {
|
||||
Dialog.confirm(l('Warning'),
|
||||
l('Save preferences and reload page now?'),
|
||||
{ok: l('Yes'), cancel: l('No')})
|
||||
.then(function() {
|
||||
save().then(function() {
|
||||
$window.location.reload(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addCalendarCategory() {
|
||||
vm.preferences.defaults.SOGoCalendarCategoriesColors["New category"] = "#aaa";
|
||||
vm.preferences.defaults.SOGoCalendarCategories.push("New category");
|
||||
|
||||
Reference in New Issue
Block a user