Skip to content

Commit

Permalink
fix(menu,refinementList): sort by count AND name to avoid reorders on…
Browse files Browse the repository at this point in the history
… refine

fixes #65
  • Loading branch information
vvo committed Mar 2, 2016
1 parent 27f39aa commit 02fe7bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/widgets/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let bem = bemHelper('ais-menu');
* @function menu
* @param {string|DOMElement} options.container CSS Selector or DOMElement to insert the widget
* @param {string} options.attributeName Name of the attribute for faceting
* @param {string[]|Function} [options.sortBy=['count:desc']] How to sort refinements. Possible values: `count|isRefined|name:asc|desc`
* @param {string[]|Function} [options.sortBy=['count:desc', 'name:asc']] How to sort refinements. Possible values: `count|isRefined|name:asc|desc`
* @param {string} [options.limit=10] How many facets values to retrieve
* @param {object|boolean} [options.showMore=false] Limit the number of results and display a showMore button
* @param {object} [options.showMore.templates] Templates to use for showMore
Expand Down Expand Up @@ -51,7 +51,7 @@ const usage = `Usage:
menu({
container,
attributeName,
[ sortBy ],
[ sortBy=['count:desc', 'name:asc'] ],
[ limit=10 ],
[ cssClasses.{root,list,item} ],
[ templates.{header,item,footer} ],
Expand All @@ -63,7 +63,7 @@ menu({
function menu({
container,
attributeName,
sortBy = ['count:desc'],
sortBy = ['count:desc', 'name:asc'],
limit = 10,
cssClasses: userCssClasses = {},
templates = defaultTemplates,
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/refinement-list/refinement-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let bem = bemHelper('ais-refinement-list');
* @param {string|DOMElement} options.container CSS Selector or DOMElement to insert the widget
* @param {string} options.attributeName Name of the attribute for faceting
* @param {string} [options.operator='or'] How to apply refinements. Possible values: `or`, `and`
* @param {string[]|Function} [options.sortBy=['count:desc']] How to sort refinements. Possible values: `count|isRefined|name:asc|desc`
* @param {string[]|Function} [options.sortBy=['count:desc', 'name:asc']] How to sort refinements. Possible values: `count|isRefined|name:asc|desc`
* @param {string} [options.limit=10] How much facet values to get. When the show more feature is activated this is the minimun number of facets requested (the show more button is not in active state).
* @param {object|boolean} [options.showMore=false] Limit the number of results and display a showMore button
* @param {object} [options.showMore.templates] Templates to use for showMore
Expand Down Expand Up @@ -53,7 +53,7 @@ refinementList({
container,
attributeName,
[ operator='or' ],
[ sortBy=['count:desc'] ],
[ sortBy=['count:desc', 'name:asc'] ],
[ limit=10 ],
[ cssClasses.{root, header, body, footer, list, item, active, label, checkbox, count}],
[ templates.{header,item,footer} ],
Expand All @@ -67,7 +67,7 @@ function refinementList({
container,
attributeName,
operator = 'or',
sortBy = ['count:desc'],
sortBy = ['count:desc', 'name:asc'],
limit = 10,
cssClasses: userCssClasses = {},
templates = defaultTemplates,
Expand Down

0 comments on commit 02fe7bf

Please sign in to comment.