Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
16bb015f
Commit
16bb015f
authored
Mar 17, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ssss
parent
24e076ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
switcher.component.ts
.../src/app/shared/components/switcher/switcher.component.ts
+16
-16
No files found.
Web-Manage/src/app/shared/components/switcher/switcher.component.ts
View file @
16bb015f
...
...
@@ -29,9 +29,9 @@ export class SwitcherComponent {
localStorage
.
setItem
(
'ynex-menu-mode'
,
type2
);
if
(
localStorage
.
getItem
(
'ynex-header-mode'
)
==
'light'
)
{
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
removeAttribute
(
'style'
);
//
localStorage.removeItem('ynexlight-background-light');
//
this.body = document.querySelector('body');
//
this.body?.classList.remove('dark');
localStorage
.
removeItem
(
'ynexlight-background-light'
);
this
.
body
=
document
.
querySelector
(
'body'
);
this
.
body
?.
classList
.
remove
(
'dark'
);
}
if
(
localStorage
.
getItem
(
'ynex-theme-mode'
)
==
'light'
)
{
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
removeAttribute
(
'style'
);
...
...
@@ -45,14 +45,14 @@ export class SwitcherComponent {
//
this.body = document.querySelector('body');
//
this.body?.classList.remove('dark');
this
.
body
=
document
.
querySelector
(
'body'
);
this
.
body
?.
classList
.
remove
(
'dark'
);
}
}
DirectionsChange
(
type
:
string
)
{
//
this.elementRef.nativeElement.ownerDocument.documentElement?.setAttribute('dir', type);
//
localStorage.setItem('ynex-dir', type);
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
setAttribute
(
'dir'
,
type
);
localStorage
.
setItem
(
'ynex-dir'
,
type
);
const
htmlElement
=
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
;
this
.
renderer
.
setAttribute
(
htmlElement
,
'dir'
,
type
);
...
...
@@ -76,8 +76,8 @@ export class SwitcherComponent {
mainContentElement
.
click
();
}
},
100
);
}
else
{
this
.
renderer
.
setAttribute
(
htmlElement
,
'data-menu-styles'
,
'dark'
);
...
...
@@ -111,7 +111,7 @@ export class SwitcherComponent {
localStorage
.
removeItem
(
'ynex-sidemenu-styles-toggled'
);
}
SideMenus
(
type
:
string
,
type1
:
string
)
{
this
.
navServices
.
items
.
subscribe
((
items
)
=>
{
this
.
menuItems
=
items
;
...
...
@@ -119,15 +119,15 @@ export class SwitcherComponent {
const
htmlElement
=
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
;
this
.
renderer
.
setAttribute
(
htmlElement
,
'data-vertical-style'
,
type1
);
if
(
localStorage
.
getItem
(
'ynex-sidemenu-styles'
)
==
'closed'
){
this
.
renderer
.
setAttribute
(
htmlElement
,
'data-toggled'
,
type
);
}
else
if
(
localStorage
.
getItem
(
'ynex-sidemenu-styles'
)
==
'closed'
){
this
.
renderer
.
removeAttribute
(
htmlElement
,
'data-toggled'
);
}
localStorage
.
setItem
(
'ynex-sidemenu-styles'
,
type1
);
localStorage
.
setItem
(
'ynex-sidemenu-styles-toggled'
,
type
);
this
.
renderer
.
setAttribute
(
htmlElement
,
'data-toggled'
,
type
);
...
...
@@ -202,7 +202,7 @@ export class SwitcherComponent {
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
style
.
setProperty
(
'--primary'
,
type
);
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
style
.
setProperty
(
'--primary-rgb'
,
type
);
localStorage
.
setItem
(
'ynex-primary-mode'
,
type
);
//
localStorage.removeItem('ynexlight-primary-color');
localStorage
.
removeItem
(
'ynexlight-primary-color'
);
}
background
(
lightBg
:
string
,
inputBorder
:
string
,
bodyBg
:
string
,
darkBg
:
string
,
type
:
string
,
type1
:
string
)
{
this
.
elementRef
.
nativeElement
.
ownerDocument
.
documentElement
?.
style
.
setProperty
(
'--light'
,
lightBg
);
...
...
@@ -253,7 +253,7 @@ export class SwitcherComponent {
// removing data from session storage
// switcher.checkOptions();
//
localStorage.removeItem('ynex-primary-mode');
localStorage
.
removeItem
(
'ynex-primary-mode'
);
}
//background theme change
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment