Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SWITCHwayf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
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
Guillaume Rousse
SWITCHwayf
Commits
629a3908
Commit
629a3908
authored
Oct 08, 2012
by
haemmer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented #2077
parent
9ba94e07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
js/improvedDropDown.js
js/improvedDropDown.js
+11
-3
No files found.
js/improvedDropDown.js
View file @
629a3908
...
...
@@ -42,6 +42,9 @@ var KEY_PRESS_FILTER_DELAY_MS = 120;
var
resizeHandlerSet
=
false
;
var
suspendTextBoxExitHandler
=
false
;
// Stores number of entries that matched for text
var
matchedEntries
=
0
;
(
function
(
$
)
{
$
.
fn
.
improveDropDown
=
function
(
value
)
{
if
(
!
resizeHandlerSet
)
{
...
...
@@ -183,8 +186,10 @@ function getTextElement(sourceElement, imgElement) {
case
KEY_ESCAPE
:
closeListUndoTyping
(
thisTextElement
);
break
;
case
KEY_TAB
:
break
;
case
KEY_ENTER
:
// Move focus on submit button
$
(
'
[type="submit"]
'
).
focus
();
// Submit if only one entry matches
if
(
matchedEntries
==
1
)
{
$
(
'
[type="submit"]
'
).
click
();
}
break
;
case
KEY_DOWNARROW
:
break
;
case
KEY_UPARROW
:
break
;
...
...
@@ -377,7 +382,7 @@ function populateListItem(newListControl, optionItem) {
newListItem
.
mouseout
(
function
()
{
$
(
this
).
removeClass
(
'
idd_listItem_Hover
'
);
});
newListItem
.
click
(
function
()
{
selectItem
(
$
(
this
),
true
,
true
,
false
);
$
(
'
[type="submit"]
'
).
focus
();
$
(
'
[type="submit"]
'
).
click
();
});
}
else
{
...
...
@@ -444,6 +449,9 @@ function getBestMatch(value, listControl) {
var
bestMatchElement
;
// Store matched entries
matchedEntries
=
filterMatches
.
length
;
switch
(
filterMatches
.
length
)
{
case
0
:
bestMatchElement
=
null
;
break
;
case
1
:
bestMatchElement
=
filterMatches
.
first
();
break
;
...
...
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