BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
compare.js.coffee
app/assets/javascripts/compare.js.coffee
+1
-0
gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+24
-1
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