Skip to content

Commit

Permalink
remove toggle button theme from header (#4312)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo authored Sep 14, 2023
1 parent b72dd5a commit d088323
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
7 changes: 7 additions & 0 deletions scripts/apps/users/directives/UserPreferencesDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions scripts/core/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 0 additions & 4 deletions scripts/core/menu/views/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ <h1 class="sd-top-menu__header" ng-if="currentRoute.category === 'superdesk.core
<sd-global-menu-horizontal></sd-global-menu-horizontal>
</div>

<button class="navbtn" ng-click="toggleTheme()">
<i class="icon-adjust" style="color: white"></i>
</button>

<button class="navbtn dropdown__toggle" ng-click="toggleNotifications()"
aria-label="{{ 'View notifications' | translate }}">
<span id="unread-count" class="badge badge--primary" ng-show="notifications.unread">{{
Expand Down

0 comments on commit d088323

Please sign in to comment.