Merge pull request #2382 from jblashka/master
Fix JS error when working with theme i18n settings
This commit is contained in:
commit
e56759a6c0
1 changed files with 5 additions and 6 deletions
|
@ -352,15 +352,14 @@ module.controller('RealmThemeCtrl', function($scope, Current, Realm, realm, serv
|
||||||
|
|
||||||
function updateSupported() {
|
function updateSupported() {
|
||||||
if ($scope.realm.internationalizationEnabled) {
|
if ($scope.realm.internationalizationEnabled) {
|
||||||
var accountLocales = localeForTheme('account', $scope.realm.loginTheme);
|
var accountLocales = localeForTheme('account', $scope.realm.accountTheme);
|
||||||
var adminLocales = localeForTheme('admin', $scope.realm.loginTheme);
|
|
||||||
var loginLocales = localeForTheme('login', $scope.realm.loginTheme);
|
var loginLocales = localeForTheme('login', $scope.realm.loginTheme);
|
||||||
var emailLocales = localeForTheme('email', $scope.realm.loginTheme);
|
var emailLocales = localeForTheme('email', $scope.realm.emailTheme);
|
||||||
|
|
||||||
var supportedLocales = [];
|
var supportedLocales = [];
|
||||||
for (var i = 0; i < accountLocales.length; i++) {
|
for (var i = 0; i < accountLocales.length; i++) {
|
||||||
var l = accountLocales[i];
|
var l = accountLocales[i];
|
||||||
if (adminLocales.indexOf(l) >= 0 && loginLocales.indexOf(l) >= 0 && emailLocales.indexOf(l) >= 0) {
|
if (loginLocales.indexOf(l) >= 0 && emailLocales.indexOf(l) >= 0) {
|
||||||
supportedLocales.push(l);
|
supportedLocales.push(l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,7 +370,7 @@ module.controller('RealmThemeCtrl', function($scope, Current, Realm, realm, serv
|
||||||
$scope.realm.supportedLocales = supportedLocales;
|
$scope.realm.supportedLocales = supportedLocales;
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < $scope.realm.supportedLocales.length; i++) {
|
for (var i = 0; i < $scope.realm.supportedLocales.length; i++) {
|
||||||
if ($scope.realm.supportedLocales.indexOf($scope.realm.supportedLocales[i]) == -1) {
|
if (supportedLocales.indexOf($scope.realm.supportedLocales[i]) == -1) {
|
||||||
$scope.realm.supportedLocales = supportedLocales;
|
$scope.realm.supportedLocales = supportedLocales;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue