Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
ed6d69b2
Commit
ed6d69b2
authored
Sep 13, 2022
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UTILS.js - add createSelectComponent method
parent
873c93e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
constructor/library/UTILS.js
constructor/library/UTILS.js
+15
-0
No files found.
constructor/library/UTILS.js
View file @
ed6d69b2
...
...
@@ -264,6 +264,21 @@ UTILS.parseRegistryList = list => {
return
result
;
}
UTILS
.
createSelectComponent
=
(
label
,
items
,
multiple
=
false
)
=>
{
const
container
=
$
(
'
<div>
'
,
{
class
:
'
uk-margin-small
'
});
const
fc
=
$
(
'
<div>
'
,
{
class
:
'
uk-form-controls
'
});
const
select
=
$
(
'
<select class="uk-select" style="min-width: 100px;">
'
);
if
(
multiple
)
select
.
attr
(
'
multiple
'
,
'
multiple
'
);
if
(
items
)
items
.
sort
((
a
,
b
)
=>
a
.
value
-
b
.
value
)
.
forEach
(
item
=>
select
.
append
(
`<option value="
${
item
.
value
}
" title="
${
item
.
label
}
">
${
item
.
label
}
</option>`
));
fc
.
append
(
select
);
container
.
append
(
`<label class="uk-form-label uk-text-bold">
${
label
}
</label>`
).
append
(
fc
);
return
{
container
,
select
};
}
UTILS
.
detectBrowser
=
()
=>
{
const
browserVersion
=
(
userAgent
,
regex
)
=>
{
return
userAgent
.
match
(
regex
)
?
userAgent
.
match
(
regex
)[
2
]
:
null
;
...
...
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