Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
badb6c42
Commit
badb6c42
authored
6 years ago
by
Michael Lange
Browse files
Options
Download
Email Patches
Plain Diff
Add onChange hook to the search-box component
parent
4b08ef05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ui/app/components/search-box.js
+6
-1
ui/app/components/search-box.js
with
6 additions
and
1 deletion
+6
-1
ui/app/components/search-box.js
+
6
-
1
View file @
badb6c42
...
...
@@ -12,6 +12,9 @@ export default Component.extend({
// Used to throttle sets to searchTerm
debounce
:
150
,
// A hook that's called when the search value changes
onChange
()
{},
classNames
:
[
'
search-box
'
,
'
field
'
,
'
has-addons
'
],
actions
:
{
...
...
@@ -23,5 +26,7 @@ export default Component.extend({
});
function
updateSearch
()
{
this
.
set
(
'
searchTerm
'
,
this
.
get
(
'
_searchTerm
'
));
const
newTerm
=
this
.
get
(
'
_searchTerm
'
);
this
.
onChange
(
newTerm
);
this
.
set
(
'
searchTerm
'
,
newTerm
);
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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