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
beab104d
Commit
beab104d
authored
Mar 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filters by text on element
parent
850fa65e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
app/assets/javascripts/compare.js.coffee
app/assets/javascripts/compare.js.coffee
+1
-0
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+30
-7
No files found.
app/assets/javascripts/compare.js.coffee
View file @
beab104d
...
...
@@ -9,6 +9,7 @@ class @Compare
$dropdown
.
glDropdown
(
selectable
:
true
fieldName
:
$dropdown
.
data
'field-name'
filterable
:
true
id
:
(
obj
,
$el
)
->
$el
.
data
'id'
toggleLabel
:
(
obj
,
$el
)
->
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
beab104d
...
...
@@ -57,6 +57,8 @@ class GitLabDropdownFilter
filter
:
(
search_text
)
->
data
=
@
options
.
data
()
if
data
?
results
=
data
if
search_text
isnt
""
...
...
@@ -65,6 +67,20 @@ class GitLabDropdownFilter
)
@
options
.
callback
results
else
elements
=
@
options
.
elements
()
if
search_text
elements
.
each
->
$el
=
$
(
@
)
matches
=
fuzzaldrinPlus
.
match
(
$el
.
text
().
trim
(),
search_text
)
if
matches
.
length
$el
.
show
()
else
$el
.
hide
()
else
elements
.
show
()
class
GitLabDropdownRemote
constructor
:
(
@
dataEndpoint
,
@
options
)
->
...
...
@@ -147,7 +163,14 @@ class GitLabDropdown
filterInputBlur
:
@
filterInputBlur
remote
:
@
options
.
filterRemote
query
:
@
options
.
data
keys
:
@
options
.
search
.
fields
keys
:
search_fields
elements
:
=>
selector
=
".dropdown-content li:not(.divider)"
if
@
dropdown
.
find
(
".dropdown-toggle-page"
).
length
selector
=
".dropdown-page-one
#{
selector
}
"
return
$
(
selector
)
data
:
=>
return
@
fullData
callback
:
(
data
)
=>
...
...
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