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
93ec237f
Commit
93ec237f
authored
Nov 04, 2022
by
NGO THI HONG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug operation select , template
parent
eddb2861
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
16 deletions
+54
-16
abvw/html/notification-content.html
+1
-1
abvw/js/notification-content/notification-content.js
+44
-7
abvw/js/operationSelect/operation-select.js
+9
-8
No files found.
abvw/html/notification-content.html
View file @
93ec237f
...
...
@@ -13,7 +13,7 @@
</ul>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary lang"
lang=
"selection"
></button>
<button
type=
"button"
class=
"btn btn-primary lang"
lang=
"selection"
onclick=
"NotificationSelect.onClickTempalte();"
></button>
<button
type=
"button"
class=
"btn btn-tertiary lang"
lang=
"dspCancel"
data-dismiss=
"modal"
></button>
</div>
</div>
...
...
abvw/js/notification-content/notification-content.js
View file @
93ec237f
...
...
@@ -4,6 +4,7 @@
* @since 1.0 check web
*/
var
NotificationSelect
=
{};
NotificationSelect
.
changeSelectCallback
=
function
()
{};
NotificationSelect
.
nameSelected
=
""
;
NotificationSelect
.
valueSelected
=
""
;
...
...
@@ -48,24 +49,26 @@ NotificationSelect.selectOperationClick = function () {
/**
* init data, action when screen onload
*/
NotificationSelect
.
init
=
function
()
{
NotificationSelect
.
init
=
function
(
selectedCallback
)
{
NotificationSelect
.
getNotificationSelectData
(
function
(
data
)
{
NotificationSelect
.
createNotificationSelectList
(
data
);
if
(
typeof
data
===
'undefined'
||
data
==
null
)
return
;
NotificationSelect
.
createNotificationSelectList
(
data
.
pushMessageTemplate
);
});
NotificationSelect
.
selectOperationClick
();
NotificationSelect
.
changeSelectCallback
=
selectedCallback
;
};
/**
* Implement notification select html
* @returns
*/
NotificationSelect
.
createNotificationSelectList
=
function
(
data
)
{
NotificationSelect
.
createNotificationSelectList
=
function
(
pushMessageTemplate
)
{
$
(
"#notificationSelectList"
).
empty
();
if
(
typeof
data
===
'undefined'
||
data
.
length
<
1
)
return
;
if
(
typeof
pushMessageTemplate
===
'undefined'
||
pushMessageTemplate
.
length
<
1
)
return
;
let
classSelected
=
"selected"
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
pushMessageTemplate
.
length
;
i
++
)
{
let
divName
=
$
(
"<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>"
+
data
[
i
].
name
+
"</div>"
);
let
divName
=
$
(
"<div class='pl-5 py-3 h-100 w-100 align-self-center select-label'>"
+
pushMessageTemplate
[
i
].
name
+
"</div>"
);
let
divIcon
=
$
(
"<div class='flex-shrink-1 mx-3 align-self-center'>"
+
"<button class='btn btn-link border collapsed' type='button' data-toggle='collapse' data-target='#collapse"
+
i
+
"' aria-expanded='true' aria-controls='collapse"
+
i
+
"'>"
+
"<div class='arrow-icon'></div>"
...
...
@@ -76,7 +79,7 @@ NotificationSelect.init = function () {
classSelected
=
""
;
let
divValue
=
$
(
"<div id='collapse"
+
i
+
"' class='collapse' aria-labelledby='heading"
+
i
+
"' data-parent='#accordion"
+
i
+
"'></div>"
);
let
divBodyValue
=
$
(
"<div class='card-body'>"
+
data
[
i
].
value
+
"</div>"
);
let
divBodyValue
=
$
(
"<div class='card-body'>"
+
pushMessageTemplate
[
i
].
value
+
"</div>"
);
let
messageli
=
$
(
"<li class='accordion' id='accordion"
+
i
+
"'></li>"
);
...
...
@@ -86,7 +89,40 @@ NotificationSelect.init = function () {
divValue
.
append
(
divBodyValue
);
messageli
.
append
(
divParentName
);
messageli
.
append
(
divValue
);
if
(
i
==
0
)
{
NotificationSelect
.
nameSelected
=
pushMessageTemplate
[
i
].
name
;
NotificationSelect
.
valueSelected
=
pushMessageTemplate
[
i
].
value
;
}
$
(
"#notificationSelectList"
).
append
(
messageli
);
}
}
/**
* handle click event of select button
*/
NotificationSelect
.
onClickTempalte
=
function
()
{
NotificationSelect
.
chooseTemplate
();
};
/**
* Get operation select and call back function in main page
*/
NotificationSelect
.
chooseTemplate
=
function
()
{
let
param
=
{};
param
.
nameSelected
=
NotificationSelect
.
nameSelected
;
param
.
valueSelected
=
NotificationSelect
.
valueSelected
;
NotificationSelect
.
closeModal
();
if
(
NotificationSelect
.
changeSelectCallback
&&
typeof
NotificationSelect
.
changeSelectCallback
===
'function'
)
{
NotificationSelect
.
changeSelectCallback
(
param
.
valueSelected
);
}
};
/**
* close setting dialog
*/
NotificationSelect
.
closeModal
=
function
()
{
$
(
'#select-template-modal .close'
).
click
();
};
\ No newline at end of file
abvw/js/operationSelect/operation-select.js
View file @
93ec237f
...
...
@@ -52,7 +52,8 @@ OperationSelect.selectOperationClick = function () {
*/
OperationSelect
.
init
=
function
(
selectedCallback
)
{
OperationSelect
.
getOperationSelectData
(
function
(
data
)
{
OperationSelect
.
createOperationSelectList
(
data
);
if
(
typeof
data
===
'undefined'
||
data
==
null
)
return
;
OperationSelect
.
createOperationSelectList
(
data
.
operationList
);
});
OperationSelect
.
selectOperationClick
();
OperationSelect
.
changeSelectCallback
=
selectedCallback
;
...
...
@@ -62,14 +63,14 @@ OperationSelect.init = function (selectedCallback) {
* Implement operation select html
* @returns
*/
OperationSelect
.
createOperationSelectList
=
function
(
data
)
{
OperationSelect
.
createOperationSelectList
=
function
(
operationList
)
{
$
(
"#operationSelectList"
).
empty
();
if
(
typeof
data
===
'undefined'
||
data
.
length
<
1
)
return
;
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
if
(
typeof
operationList
===
'undefined'
||
operationList
.
length
<
1
)
return
;
for
(
let
i
=
0
;
i
<
operationList
.
length
;
i
++
)
{
let
messageli
=
$
(
"<li class='card mb-2' name = 'operationId_"
+
data
[
i
].
operationId
+
"' ></li>"
);
let
ahrefRequiredFlg
=
$
(
"<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='"
+
data
[
i
].
operationId
+
"' data-name='"
+
data
[
i
].
operationName
+
"' ></a>"
);
let
divText
=
$
(
"<div class='fs-12 text-truncate d-block'>"
+
data
[
i
].
operationName
+
"</div>"
);
let
messageli
=
$
(
"<li class='card mb-2' name = 'operationId_"
+
operationList
[
i
].
operationId
+
"' ></li>"
);
let
ahrefRequiredFlg
=
$
(
"<a href='#' class='d-block px-5 py-3 text-decoration-none select-label' data-key='"
+
operationList
[
i
].
operationId
+
"' data-name='"
+
operationList
[
i
].
operationName
+
"' ></a>"
);
let
divText
=
$
(
"<div class='fs-12 text-truncate d-block'>"
+
operationList
[
i
].
operationName
+
"</div>"
);
ahrefRequiredFlg
.
append
(
divText
);
messageli
.
append
(
ahrefRequiredFlg
);
...
...
@@ -97,7 +98,7 @@ OperationSelect.init = function (selectedCallback) {
param
.
operationNameSelected
=
OperationSelect
.
operationNameSelected
;
OperationSelect
.
closeModal
();
if
(
OperationSelect
.
changeSelectCallback
&&
typeof
OperationSelect
.
changeSelectCallback
===
'function'
)
{
OperationSelect
.
changeSelectCallback
(
param
);
OperationSelect
.
changeSelectCallback
(
param
.
operationIdSelected
,
param
.
operationNameSelected
);
}
};
...
...
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