File tree 2 files changed +24
-14
lines changed
2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,22 @@ var instant = new instantsearch.InstantSearch(
8
8
'bestbuy'
9
9
) ;
10
10
11
- instant . addWidget ( instantsearch . widgets . searchbox ( {
12
- container : '#search-box' ,
13
- placeholder : 'Search for products in France...'
14
- } ) ) ;
11
+ instant . addWidget (
12
+ instantsearch . widgets . searchbox ( {
13
+ container : '#search-box' ,
14
+ placeholder : 'Search for products' ,
15
+ addClass : 'form-control'
16
+ } )
17
+ ) ;
15
18
16
- instant . addWidget ( instantsearch . widgets . results ( {
19
+ instant . addWidget (
20
+ instantsearch . widgets . results ( {
17
21
container : '#hits' ,
18
- templates : {
19
- noResults : require ( './templates/no-results.html' ) ,
20
- hit : require ( './templates/hit.html' )
21
- }
22
- } ) ) ;
22
+ templates : {
23
+ noResults : require ( './templates/no-results.html' ) ,
24
+ hit : require ( './templates/hit.html' )
25
+ }
26
+ } )
27
+ ) ;
23
28
24
29
instant . start ( ) ;
Original file line number Diff line number Diff line change @@ -4,13 +4,18 @@ var React = require('react');
4
4
5
5
var utils = require ( '../../lib/widgetUtils' ) ;
6
6
7
- function searchbox ( parameters ) {
7
+ function searchbox ( params ) {
8
8
var SearchBox = require ( '../../components/SearchBox' ) ;
9
- var container = utils . getContainerNode ( parameters . container ) ;
9
+ var container = utils . getContainerNode ( params . container ) ;
10
+
10
11
return {
11
12
init : function ( initialState , helper ) {
12
- React . render ( < SearchBox helper = { helper }
13
- placeholder = { parameters . placeholder } /> , container ) ;
13
+ React . render (
14
+ < SearchBox
15
+ helper = { helper }
16
+ placeholder = { params . placeholder }
17
+ inputClass = { params . addClass } /> , container
18
+ ) ;
14
19
}
15
20
} ;
16
21
}
You can’t perform that action at this time.
0 commit comments