Skip to content

Commit

Permalink
Merge pull request #85 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release version 3.0.3
  • Loading branch information
PierreRambaud committed Jun 6, 2019
2 parents 4695894 + d3fd4ca commit d5ed634
Show file tree
Hide file tree
Showing 30 changed files with 1,691 additions and 649 deletions.
1 change: 1 addition & 0 deletions _dev/front/index.js
Expand Up @@ -22,6 +22,7 @@
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
import 'jquery-ui-touch-punch';
import './events';
import './slider.scss';
import './facet.scss';
14 changes: 8 additions & 6 deletions _dev/front/slider.js
Expand Up @@ -26,10 +26,10 @@
import getQueryParameters from './urlparser';
import NumberFormatter from '../cldr/number-formatter';

let formatter;
const formatters = {};

const displayLabelBlock = (displayBlock, min, max) => {
if (formatter === undefined) {
const displayLabelBlock = (formatterId, displayBlock, min, max) => {
if (formatters[formatterId] === undefined) {
displayBlock.text(
displayBlock.text().replace(
/([^\d]*)(?:[\d .,]+)([^\d]+)(?:[\d .,]+)(.*)/,
Expand All @@ -38,7 +38,7 @@ const displayLabelBlock = (displayBlock, min, max) => {
);
} else {
displayBlock.text(
`${formatter.format(min)} - ${formatter.format(max)}`,
`${formatters[formatterId].format(min)} - ${formatters[formatterId].format(max)}`,
);
}
};
Expand All @@ -52,10 +52,11 @@ const refreshSliders = () => {
const values = $el.data('slider-values');
const specifications = $el.data('slider-specifications');
if (specifications !== null && specifications !== undefined) {
formatter = NumberFormatter.build(specifications);
formatters[$el.data('slider-id')] = NumberFormatter.build(specifications);
}

displayLabelBlock(
$el.data('slider-id'),
$(`#facet_label_${$el.data('slider-id')}`),
values === null ? $el.data('slider-min') : values[0],
values === null ? $el.data('slider-max') : values[1],
Expand All @@ -69,7 +70,7 @@ const refreshSliders = () => {
values === null ? $el.data('slider-min') : values[0],
values === null ? $el.data('slider-max') : values[1],
],
change(event, ui) {
stop(event, ui) {
const nextEncodedFacetsURL = $el.data('slider-encoded-url');
const urlsSplitted = nextEncodedFacetsURL.split('?');
let queryParams = [];
Expand Down Expand Up @@ -120,6 +121,7 @@ const refreshSliders = () => {
},
slide(event, ui) {
displayLabelBlock(
$el.data('slider-id'),
$(`#facet_label_${$el.data('slider-id')}`),
ui.values[0],
ui.values[1],
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -16,7 +16,8 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.14",
"phpunit/phpunit": "~5.7",
"prestashop/php-coding-standards": "dev-master"
"prestashop/php-coding-standards": "dev-master",
"mockery/mockery": "^1.2"
},
"config": {
"platform": {
Expand Down
115 changes: 114 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config.xml
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_facetedsearch</name>
<displayName><![CDATA[Faceted search]]></displayName>
<version><![CDATA[3.0.2]]></version>
<version><![CDATA[3.0.3]]></version>
<description><![CDATA[Displays a block allowing multiple filters.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down

0 comments on commit d5ed634

Please sign in to comment.