Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove toggle button theme from header #4312

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-ui';
Copy link
Member

@tomaskikutis tomaskikutis Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use capital letters for a variable name - THEME_LIGHT


/**
* @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;
}

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
Loading