Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IOU
microdep
Commits
b20d6255
Commit
b20d6255
authored
Jan 19, 2022
by
Otto Jonassen Wittner
Browse files
Sorting of select-lists added.
parent
bef50937
Pipeline
#50548
passed with stages
in 1 minute and 3 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
server/script/microdep-map.html
View file @
b20d6255
...
...
@@ -442,6 +442,10 @@ function make_prop_select(id, names, desc){
option
.
text
=
text
;
selectList
.
appendChild
(
option
);
}
// Sort list alphabetically (from https://stackoverflow.com/questions/667010/sorting-dropdown-list-using-javascript/667198#667198)
$
(
"
#
"
+
id
).
html
(
$
(
"
#
"
+
id
+
"
option
"
).
sort
(
function
(
a
,
b
)
{
return
a
.
text
==
b
.
text
?
0
:
a
.
text
<
b
.
text
?
-
1
:
1
}))
}
...
...
@@ -2021,22 +2025,8 @@ $(document).ready ( function(){
// event_type parameter change
$
(
"
#event_type
"
).
change
(
function
(){
parms
.
event
=
$
(
"
#event_type
"
).
val
()
// Refresh measurement variable (property) select list
prop_names
=
prop_names_list
[
parms
.
event
];
update_props
();
//remove_links();
prop_names
=
prop_names_list
[
parms
.
event
];
make_prop_select
(
"
prop_select
"
,
prop_names
,
prop_desc
);
// Select measurement variable
if
(
parms
.
property
&&
(
prop_names
.
indexOf
(
parms
.
property
)
>
-
1
))
{
$
(
"
#prop_select
"
).
val
(
parms
.
property
);
}
else
{
// Apply default measurement variable/property if available
if
(
"
default_field
"
in
conffile
[
parms
.
net
].
event_type
[
parms
.
event
]
)
{
$
(
"
#prop_select
"
).
val
(
conffile
[
parms
.
net
].
event_type
[
parms
.
event
].
default_field
);
}
parms
.
property
=
$
(
"
#prop_select
"
).
val
()
}
get_connections
();
update_url
();
$
(
"
#tabs
"
).
tabs
(
"
option
"
,
"
active
"
,
0
);
...
...
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