Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
fc0a3347
Commit
fc0a3347
authored
Oct 24, 2022
by
NGUYEN HOANG SON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comment code fiel dashboad-setting js
parent
23d38ca7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
abvw/js/dashboardSetting/dashboard-setting.js
+6
-2
No files found.
abvw/js/dashboardSetting/dashboard-setting.js
View file @
fc0a3347
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
* @since 1.0 check web
* @since 1.0 check web
*/
*/
var
DashboardSetting
=
{};
var
DashboardSetting
=
{};
//setting html elements, map with json key from setting data API
DashboardSetting
.
elementItems
=
{
DashboardSetting
.
elementItems
=
{
newReport
:
{
id
:
'settingNewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
newReport
:
{
id
:
'settingNewReport'
,
name
:
'chk-new'
,
enabled
:
true
},
continousWork
:
{
id
:
'settingContinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
continousWork
:
{
id
:
'settingContinousWork'
,
name
:
'chk-proccess'
,
enabled
:
true
},
...
@@ -41,6 +43,7 @@ DashboardSetting.applySettings = function (settings) {
...
@@ -41,6 +43,7 @@ DashboardSetting.applySettings = function (settings) {
for
(
const
key
in
settings
)
{
for
(
const
key
in
settings
)
{
const
enabled
=
settings
[
key
];
const
enabled
=
settings
[
key
];
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
))
{
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
))
{
//apply enabled, disabled setting
let
elementItem
=
DashboardSetting
.
elementItems
[
key
];
let
elementItem
=
DashboardSetting
.
elementItems
[
key
];
elementItem
.
enabled
=
enabled
;
elementItem
.
enabled
=
enabled
;
let
element
=
$
(
'#'
+
elementItem
.
id
);
let
element
=
$
(
'#'
+
elementItem
.
id
);
...
@@ -71,16 +74,17 @@ DashboardSetting.saveSetting = function () {
...
@@ -71,16 +74,17 @@ DashboardSetting.saveSetting = function () {
});
});
};
};
//handle click on/off of setting item
DashboardSetting
.
bindToggleClick
=
function
()
{
DashboardSetting
.
bindToggleClick
=
function
()
{
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
'.toggle'
).
on
(
'click'
,
function
()
{
$
(
this
).
toggleClass
(
'checked'
);
$
(
this
).
toggleClass
(
'checked'
);
const
key
=
$
(
this
).
attr
(
'data-key'
);
const
key
=
$
(
this
).
attr
(
'data-key'
);
var
enabled
=
false
;
let
enabled
=
false
;
if
(
$
(
this
).
hasClass
(
'checked'
))
{
if
(
$
(
this
).
hasClass
(
'checked'
))
{
enabled
=
true
;
enabled
=
true
;
}
}
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
))
{
if
(
DashboardSetting
.
elementItems
.
hasOwnProperty
(
key
))
{
cons
t
elementItem
=
DashboardSetting
.
elementItems
[
key
];
le
t
elementItem
=
DashboardSetting
.
elementItems
[
key
];
elementItem
.
enabled
=
enabled
;
elementItem
.
enabled
=
enabled
;
}
}
});
});
...
...
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