diff --git a/scripts/apps/users/directives/UserPreferencesDirective.ts b/scripts/apps/users/directives/UserPreferencesDirective.ts index 49fba616da..b53d0c3681 100644 --- a/scripts/apps/users/directives/UserPreferencesDirective.ts +++ b/scripts/apps/users/directives/UserPreferencesDirective.ts @@ -4,6 +4,8 @@ import {gettext} from 'core/utils'; import {appConfig, getUserInterfaceLanguage} from 'appConfig'; import {applyDefault} from 'core/helpers/typescript-helpers'; +const THEME_LIGHT = 'light-ui'; + /** * @ngdoc directive * @module superdesk.apps.users @@ -44,8 +46,13 @@ export function UserPreferencesDirective( const body = angular.element('body'); scope.activeNavigation = null; + scope.activeTheme = localStorage.getItem('theme'); + if (scope.activeTheme === '') { + scope.activeTheme = THEME_LIGHT; + } + scope.$watch('activeTheme', (val) => { if (!val) { return; diff --git a/scripts/core/menu/menu.ts b/scripts/core/menu/menu.ts index 28b3dbae7c..75c284f9f1 100644 --- a/scripts/core/menu/menu.ts +++ b/scripts/core/menu/menu.ts @@ -275,15 +275,6 @@ angular.module('superdesk.core.menu', [ }); } - scope.toggleTheme = function() { - scope.theme = scope.theme === 'dark-ui' ? '' : 'dark-ui'; - localStorage.setItem('theme', scope.theme); - - scope.theme ? - body.attr('data-theme', scope.theme) : - body.removeAttr('data-theme'); - }; - scope.toggleMenu = function() { ctrl.flags.menu = !ctrl.flags.menu; }; diff --git a/scripts/core/menu/views/menu.html b/scripts/core/menu/views/menu.html index 2fa9d11fcf..f5bcaddf45 100644 --- a/scripts/core/menu/views/menu.html +++ b/scripts/core/menu/views/menu.html @@ -29,10 +29,6 @@

- - -