Skip to content

Commit a7bd18c

Browse files
committed
fix readme and default tpl for view types
1 parent 9c8080b commit a7bd18c

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ JSON used for this template:
277277

278278
```
279279
{
280-
0: {
280+
options: [{
281281
"selected": true,
282282
"value": "grid"
283283
},
284-
1: {
284+
{
285285
"selected": false,
286286
"value": "list"
287-
}
287+
}]
288288
}
289289
```
290290

@@ -531,6 +531,8 @@ JSON used for this template:
531531
,setDefaultFilters : function(){
532532
//to make the results by default sorted by quantity
533533
this.addQueryParam('sort',"quantity desc");
534+
//to make default filter by category shoes
535+
this.addFilter('category_fq', 'shoes');
534536
}
535537
...
536538
```

unbxdSearch.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -466,16 +466,17 @@ var unbxdSearchInit = function(jQuery, Handlebars){
466466
'{{/options}}',
467467
'</select>'
468468
].join(''),
469-
viewTypeContainerTemp:
470-
'{{#options}}'
471-
+'<li class="unbxd-{{#if selected}}current{{/if}}">'
472-
+'<a title="{{value}} View" class="unbxd-{{value}}view-button" {{#unless selected}}unbxdviewtype="{{value}}"{{/unless}}>'
473-
+'<span class="icon-{{value}}view">'
474-
+'{{value}}{{#if selected}}-current{{/if}}'
475-
+'</span>'
476-
+'</a>'
477-
+'</li>'
478-
+'{{/options}}'
469+
viewTypeContainerTemp: [
470+
'{{#options}}',
471+
'<li class="unbxd-{{#if selected}}current{{/if}}">',
472+
'<a title="{{value}} View" class="unbxd-{{value}}view-button" {{#unless selected}}unbxdviewtype="{{value}}"{{/unless}}>',
473+
'<span class="icon-{{value}}view">',
474+
'{{value}}{{#if selected}}-current{{/if}}',
475+
'</span>',
476+
'</a>',
477+
'</li>',
478+
'{{/options}}'
479+
].join('')
479480
};
480481

481482
jQuery.extend(Unbxd.setSearch.prototype,{

0 commit comments

Comments
 (0)