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
iv
gitlab-ce
Commits
fee01133
Commit
fee01133
authored
Mar 22, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed colour of no matching results bg
Highlights first row when filtering
parent
4c5babd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+15
-5
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+6
-0
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+1
-0
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
fee01133
...
@@ -2,8 +2,7 @@ class GitLabDropdownFilter
...
@@ -2,8 +2,7 @@ class GitLabDropdownFilter
BLUR_KEYCODES
=
[
27
,
40
]
BLUR_KEYCODES
=
[
27
,
40
]
HAS_VALUE_CLASS
=
"has-value"
HAS_VALUE_CLASS
=
"has-value"
constructor
:
(
@
dropdown
,
@
options
)
->
constructor
:
(
@
input
,
@
options
)
->
@
input
=
@
dropdown
.
find
(
'.dropdown-input .dropdown-input-field'
)
$inputContainer
=
@
input
.
parent
()
$inputContainer
=
@
input
.
parent
()
$clearButton
=
$inputContainer
.
find
(
'.js-dropdown-input-clear'
)
$clearButton
=
$inputContainer
.
find
(
'.js-dropdown-input-clear'
)
...
@@ -112,7 +111,9 @@ class GitLabDropdown
...
@@ -112,7 +111,9 @@ class GitLabDropdown
# Init filiterable
# Init filiterable
if
@
options
.
filterable
if
@
options
.
filterable
@
filter
=
new
GitLabDropdownFilter
@
dropdown
,
@
input
=
@
dropdown
.
find
(
'.dropdown-input .dropdown-input-field'
)
@
filter
=
new
GitLabDropdownFilter
@
input
,
remote
:
@
options
.
filterRemote
remote
:
@
options
.
filterRemote
query
:
@
options
.
data
query
:
@
options
.
data
keys
:
@
options
.
search
.
fields
keys
:
@
options
.
search
.
fields
...
@@ -120,6 +121,7 @@ class GitLabDropdown
...
@@ -120,6 +121,7 @@ class GitLabDropdown
return
@
fullData
return
@
fullData
callback
:
(
data
)
=>
callback
:
(
data
)
=>
@
parseData
data
@
parseData
data
@
highlightRow
1
enterCallback
:
=>
enterCallback
:
=>
@
selectFirstRow
()
@
selectFirstRow
()
...
@@ -241,11 +243,19 @@ class GitLabDropdown
...
@@ -241,11 +243,19 @@ class GitLabDropdown
noResults
:
->
noResults
:
->
html
=
"<li>"
html
=
"<li>"
html
+=
"<a href='#' class='is-focused'>"
html
+=
"<a href='#' class='
dropdown-menu-empty-link
is-focused'>"
html
+=
"No matching results."
html
+=
"No matching results."
html
+=
"</a>"
html
+=
"</a>"
html
+=
"</li>"
html
+=
"</li>"
highlightRow
:
(
index
)
->
if
@
input
.
val
()
isnt
""
selector
=
'.dropdown-content li:first-child a'
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
selector
=
".dropdown-page-one .dropdown-content li:first-child a"
$
(
selector
).
addClass
'is-focused'
rowClicked
:
(
el
)
->
rowClicked
:
(
el
)
->
fieldName
=
@
options
.
fieldName
fieldName
=
@
options
.
fieldName
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
']"
)
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
']"
)
...
@@ -289,7 +299,7 @@ class GitLabDropdown
...
@@ -289,7 +299,7 @@ class GitLabDropdown
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
selector
=
".dropdown-page-one .dropdown-content li:first-child a"
selector
=
".dropdown-page-one .dropdown-content li:first-child a"
# sim
ilu
te a click on the first link
# sim
ula
te a click on the first link
$
(
selector
).
trigger
"click"
$
(
selector
).
trigger
"click"
$
.
fn
.
glDropdown
=
(
opts
)
->
$
.
fn
.
glDropdown
=
(
opts
)
->
...
...
app/assets/stylesheets/framework/dropdowns.scss
View file @
fee01133
...
@@ -130,6 +130,12 @@
...
@@ -130,6 +130,12 @@
text-decoration
:
none
;
text-decoration
:
none
;
outline
:
0
;
outline
:
0
;
}
}
&
.dropdown-menu-empty-link
{
&
.is-focused
{
background-color
:
$dropdown-empty-row-bg
;
}
}
}
}
}
}
...
...
app/assets/stylesheets/framework/variables.scss
View file @
fee01133
...
@@ -169,6 +169,7 @@ $regular_font: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif
...
@@ -169,6 +169,7 @@ $regular_font: 'Source Sans Pro', "Helvetica Neue", Helvetica, Arial, sans-serif
$dropdown-bg
:
#fff
;
$dropdown-bg
:
#fff
;
$dropdown-link-color
:
#555
;
$dropdown-link-color
:
#555
;
$dropdown-link-hover-bg
:
$row-hover
;
$dropdown-link-hover-bg
:
$row-hover
;
$dropdown-empty-row-bg
:
rgba
(
#000
,
.04
);
$dropdown-border-color
:
rgba
(
#000
,
.1
);
$dropdown-border-color
:
rgba
(
#000
,
.1
);
$dropdown-shadow-color
:
rgba
(
#000
,
.1
);
$dropdown-shadow-color
:
rgba
(
#000
,
.1
);
$dropdown-divider-color
:
rgba
(
#000
,
.1
);
$dropdown-divider-color
:
rgba
(
#000
,
.1
);
...
...
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