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
Boxiang Sun
gitlab-ce
Commits
876107d5
Commit
876107d5
authored
May 30, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix search by input
parent
c228ff0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
10 deletions
+24
-10
app/assets/javascripts/filterable_list.js
app/assets/javascripts/filterable_list.js
+15
-5
app/assets/javascripts/groups/components/group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+2
-4
app/assets/javascripts/groups/groups_filterable_list.js
app/assets/javascripts/groups/groups_filterable_list.js
+7
-1
No files found.
app/assets/javascripts/filterable_list.js
View file @
876107d5
...
...
@@ -13,14 +13,18 @@ export default class FilterableList {
initSearch
()
{
// Wrap to prevent passing event arguments to .filterResults;
this
.
debounceFilter
=
_
.
debounce
(()
=>
{
this
.
filterResults
();
},
500
);
this
.
debounceFilter
=
_
.
debounce
(
this
.
onFilterInput
.
bind
(
this
),
500
);
this
.
unbindEvents
();
this
.
bindEvents
();
}
onFilterInput
()
{
const
url
=
this
.
filterForm
.
getAttribute
(
'
action
'
);
const
data
=
$
(
this
.
filterForm
).
serialize
();
this
.
filterResults
(
url
,
data
,
'
filter-input
'
);
}
bindEvents
()
{
this
.
listFilterElement
.
addEventListener
(
'
input
'
,
this
.
debounceFilter
);
}
...
...
@@ -29,7 +33,7 @@ export default class FilterableList {
this
.
listFilterElement
.
removeEventListener
(
'
input
'
,
this
.
debounceFilter
);
}
filterResults
(
url
,
data
)
{
filterResults
(
url
,
data
,
comingFrom
)
{
const
endpoint
=
url
||
this
.
filterForm
.
getAttribute
(
'
action
'
);
const
additionalData
=
data
||
$
(
this
.
filterForm
).
serialize
();
...
...
@@ -42,7 +46,13 @@ export default class FilterableList {
dataType
:
'
json
'
,
context
:
this
,
complete
:
this
.
onFilterComplete
,
success
:
this
.
onFilterSuccess
,
success
:
(
response
,
textStatus
,
xhr
)
=>
{
if
(
this
.
preOnFilterSuccess
)
{
this
.
preOnFilterSuccess
(
comingFrom
);
}
this
.
onFilterSuccess
(
response
,
xhr
);
},
});
}
...
...
app/assets/javascripts/groups/components/group_item.vue
View file @
876107d5
...
...
@@ -16,12 +16,10 @@ export default {
},
methods
:
{
onClickRowGroup
(
e
)
{
//
e.stopPropagation();
e
.
stopPropagation
();
// Skip for buttons
if
(
e
.
target
.
tagName
===
'
A
'
||
(
e
.
target
.
tagName
===
'
I
'
&&
e
.
target
.
parentElement
.
tagName
===
'
A
'
))
{
}
else
{
if
(
!
(
e
.
target
.
tagName
===
'
A
'
)
&&
!
(
e
.
target
.
tagName
===
'
I
'
&&
e
.
target
.
parentElement
.
tagName
===
'
A
'
))
{
if
(
this
.
group
.
hasSubgroups
)
{
eventHub
.
$emit
(
'
toggleSubGroups
'
,
this
.
group
);
}
else
{
...
...
app/assets/javascripts/groups/groups_filterable_list.js
View file @
876107d5
...
...
@@ -33,7 +33,13 @@ export default class GroupFilterableList extends FilterableList {
this
.
filterResults
(
this
.
filterUrl
);
}
onFilterSuccess
(
data
,
textStatus
,
xhr
)
{
preOnFilterSuccess
(
comingFrom
)
{
if
(
comingFrom
===
'
filter-input
'
)
{
this
.
filterUrl
=
`
${
this
.
filterForm
.
getAttribute
(
'
action
'
)}
?
${
$
(
this
.
filterForm
).
serialize
()}
`
;
}
}
onFilterSuccess
(
data
,
xhr
)
{
super
.
onFilterSuccess
(
data
);
this
.
store
.
setGroups
(
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