File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { inject as service } from '@ember/service';
5
5
import { EKMixin , keyDown , keyPress } from 'ember-keyboard' ;
6
6
7
7
export default Controller . extend ( EKMixin , {
8
+ header : service ( ) ,
8
9
flashMessages : service ( ) ,
9
- search : service ( ) ,
10
10
session : service ( ) ,
11
11
12
12
keyboardActivated : true ,
@@ -26,7 +26,7 @@ export default Controller.extend(EKMixin, {
26
26
search ( ) {
27
27
this . transitionToRoute ( 'search' , {
28
28
queryParams : {
29
- q : this . search . inputValue ,
29
+ q : this . header . searchValue ,
30
30
page : 1 ,
31
31
} ,
32
32
} ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Route from '@ember/routing/route';
2
2
import { inject as service } from '@ember/service' ;
3
3
4
4
export default Route . extend ( {
5
- search : service ( ) ,
5
+ header : service ( ) ,
6
6
7
7
queryParams : {
8
8
all_keywords : { refreshModel : true } ,
@@ -18,12 +18,12 @@ export default Route.extend({
18
18
} ,
19
19
20
20
setupController ( controller , params ) {
21
- this . search . set ( 'inputValue ' , params . q ) ;
21
+ this . header . set ( 'searchValue ' , params . q ) ;
22
22
controller . dataTask . perform ( params ) ;
23
23
} ,
24
24
25
25
deactivate ( ) {
26
26
this . _super ( ...arguments ) ;
27
- this . search . set ( 'inputValue ' , null ) ;
27
+ this . header . set ( 'searchValue ' , null ) ;
28
28
} ,
29
29
} ) ;
Original file line number Diff line number Diff line change 1
1
import Service from '@ember/service' ;
2
2
3
3
export default class SearchService extends Service {
4
- inputValue = null ;
4
+ // the value of the search input fields in the header
5
+ searchValue = null ;
5
6
}
Original file line number Diff line number Diff line change 15
15
name =" q"
16
16
id =" cargo-desktop-search"
17
17
placeholder =" Click or press 'S' to search..."
18
- value ={{ this.search.inputValue }}
19
- oninput ={{ action (mut this.search.inputValue ) value =" target.value" }}
18
+ value ={{ this.header.searchValue }}
19
+ oninput ={{ action (mut this.header.searchValue ) value =" target.value" }}
20
20
autocorrect =" off"
21
21
autocapitalize =" off"
22
22
autofocus =" autofocus"
103
103
name =" q"
104
104
id =" cargo-mobile-search"
105
105
placeholder =" Search"
106
- value ={{ this.search.inputValue }}
107
- oninput ={{ action (mut this.search.inputValue ) value =" target.value" }}
106
+ value ={{ this.header.searchValue }}
107
+ oninput ={{ action (mut this.header.searchValue ) value =" target.value" }}
108
108
autocorrect =" off"
109
109
required
110
110
>
You can’t perform that action at this time.
0 commit comments