Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
8ade8258
Commit
8ade8258
authored
Aug 19, 2016
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review changes
parent
2f8fada6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+6
-9
app/assets/javascripts/search_autocomplete.js
app/assets/javascripts/search_autocomplete.js
+3
-3
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
8ade8258
...
@@ -31,9 +31,8 @@
...
@@ -31,9 +31,8 @@
this
.
input
this
.
input
.
on
(
'
keydown
'
,
function
(
e
)
{
.
on
(
'
keydown
'
,
function
(
e
)
{
var
keyCode
=
e
.
which
;
var
keyCode
=
e
.
which
;
if
(
keyCode
===
13
)
{
if
(
keyCode
===
13
)
{
e
.
preventDefault
()
e
.
preventDefault
()
;
}
}
})
})
.
on
(
'
keyup
'
,
function
(
e
)
{
.
on
(
'
keyup
'
,
function
(
e
)
{
...
@@ -179,7 +178,7 @@
...
@@ -179,7 +178,7 @@
})();
})();
GitLabDropdown
=
(
function
()
{
GitLabDropdown
=
(
function
()
{
var
ACTIVE_CLASS
,
FILTER_INPUT
,
INDETERMINATE_CLASS
,
LOADING_CLASS
,
PAGE_TWO_CLASS
,
currentIndex
;
var
ACTIVE_CLASS
,
FILTER_INPUT
,
INDETERMINATE_CLASS
,
LOADING_CLASS
,
PAGE_TWO_CLASS
,
NON_SELECTABLE_CLASSES
,
SELECTABLE_CLASSES
,
currentIndex
;
LOADING_CLASS
=
"
is-loading
"
;
LOADING_CLASS
=
"
is-loading
"
;
...
@@ -219,7 +218,7 @@
...
@@ -219,7 +218,7 @@
if
(
this
.
options
.
data
)
{
if
(
this
.
options
.
data
)
{
if
(
_
.
isObject
(
this
.
options
.
data
)
&&
!
_
.
isFunction
(
this
.
options
.
data
))
{
if
(
_
.
isObject
(
this
.
options
.
data
)
&&
!
_
.
isFunction
(
this
.
options
.
data
))
{
this
.
fullData
=
this
.
options
.
data
;
this
.
fullData
=
this
.
options
.
data
;
currentIndex
=
-
1
currentIndex
=
-
1
;
this
.
parseData
(
this
.
options
.
data
);
this
.
parseData
(
this
.
options
.
data
);
}
else
{
}
else
{
this
.
remote
=
new
GitLabDropdownRemote
(
this
.
options
.
data
,
{
this
.
remote
=
new
GitLabDropdownRemote
(
this
.
options
.
data
,
{
...
@@ -619,7 +618,7 @@
...
@@ -619,7 +618,7 @@
if
(
$el
.
length
)
{
if
(
$el
.
length
)
{
$el
.
first
().
trigger
(
'
click
'
);
$el
.
first
().
trigger
(
'
click
'
);
var
href
=
$el
.
attr
(
'
href
'
);
var
href
=
$el
.
attr
(
'
href
'
);
if
(
href
&&
href
!==
'
#
'
)
Turbolinks
.
visit
(
href
);
if
(
href
&&
href
!==
'
#
'
)
Turbolinks
.
visit
(
href
);
}
}
};
};
...
@@ -655,8 +654,6 @@
...
@@ -655,8 +654,6 @@
return
false
;
return
false
;
}
}
if
(
currentKeyCode
===
13
&&
currentIndex
!==
-
1
)
{
if
(
currentKeyCode
===
13
&&
currentIndex
!==
-
1
)
{
e
.
preventDefault
()
e
.
stopImmediatePropagation
()
return
_this
.
selectRowAtIndex
(
currentIndex
);
return
_this
.
selectRowAtIndex
(
currentIndex
);
}
}
};
};
...
@@ -687,8 +684,8 @@
...
@@ -687,8 +684,8 @@
listItemBottom
=
listItemTop
+
listItemHeight
;
listItemBottom
=
listItemTop
+
listItemHeight
;
if
(
!
index
)
{
if
(
!
index
)
{
$dropdownContent
.
scrollTop
(
0
)
$dropdownContent
.
scrollTop
(
0
)
}
else
if
(
index
===
(
$listItems
.
length
-
1
))
{
}
else
if
(
index
===
(
$listItems
.
length
-
1
))
{
$dropdownContent
.
scrollTop
(
$dropdownContent
.
prop
(
'
scrollHeight
'
));
$dropdownContent
.
scrollTop
(
$dropdownContent
.
prop
(
'
scrollHeight
'
));
}
else
if
(
listItemBottom
>
(
dropdownContentBottom
+
dropdownScrollTop
))
{
}
else
if
(
listItemBottom
>
(
dropdownContentBottom
+
dropdownScrollTop
))
{
$dropdownContent
.
scrollTop
(
listItemBottom
-
dropdownContentBottom
+
CURSOR_SELECT_SCROLL_PADDING
);
$dropdownContent
.
scrollTop
(
listItemBottom
-
dropdownContentBottom
+
CURSOR_SELECT_SCROLL_PADDING
);
}
else
if
(
listItemTop
<
(
dropdownContentTop
+
dropdownScrollTop
))
{
}
else
if
(
listItemTop
<
(
dropdownContentTop
+
dropdownScrollTop
))
{
...
...
app/assets/javascripts/search_autocomplete.js
View file @
8ade8258
...
@@ -226,11 +226,11 @@
...
@@ -226,11 +226,11 @@
this
.
restoreOriginalState
();
this
.
restoreOriginalState
();
break
;
break
;
case
KEYCODE
.
ENTER
:
case
KEYCODE
.
ENTER
:
this
.
disableAutocomplete
();
this
.
disableAutocomplete
();
break
;
break
;
case
KEYCODE
.
UP
:
case
KEYCODE
.
UP
:
case
KEYCODE
.
DOWN
:
case
KEYCODE
.
DOWN
:
return
;
return
;
default
:
default
:
if
(
this
.
searchInput
.
val
()
===
''
)
{
if
(
this
.
searchInput
.
val
()
===
''
)
{
this
.
disableAutocomplete
();
this
.
disableAutocomplete
();
...
...
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