Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Elijah Grubb
emulab-devel
Commits
db3d32fc
Commit
db3d32fc
authored
Oct 13, 2015
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When searching for a profile, if only one choice matches, typing
return now selects that profile.
parent
b3557905
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
www/aptui/js/instantiate.js
www/aptui/js/instantiate.js
+13
-1
No files found.
www/aptui/js/instantiate.js
View file @
db3d32fc
...
...
@@ -186,7 +186,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
// Profile picker search box.
var
profile_picker_timeout
=
null
;
$
(
"
#profile_picker_search
"
).
on
(
"
keyup
"
,
function
()
{
$
(
"
#profile_picker_search
"
).
on
(
"
keyup
"
,
function
(
event
)
{
var
options
=
$
(
'
#profile_name
'
);
var
userInput
=
$
(
"
#profile_picker_search
"
).
val
();
userInput
=
userInput
.
toLowerCase
();
...
...
@@ -206,6 +206,18 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
options
.
children
(
"
li
"
).
hide
();
matches
.
show
();
},
500
);
// User types return while searching, if there was only one
// choice, then we select it. Convenience.
if
(
event
.
keyCode
==
13
)
{
var
matches
=
options
.
children
(
"
li
"
).
filter
(
function
()
{
return
$
(
this
).
css
(
'
display
'
)
==
'
block
'
;
});
if
(
matches
&&
matches
.
length
==
1
)
{
ShowProfileSelection
(
matches
[
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