From 0bae5d5420efb58ac0be0abe317d01c3931e49c4 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Fri, 28 Feb 2020 20:40:32 +0100 Subject: [PATCH] Static Tests fix --- .../view/frontend/web/js/product/list/toolbar.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js b/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js index d039538582c57..738a48b3fff8b 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js @@ -81,6 +81,9 @@ define([ ); }, + /** + * @private + */ getUrlParams: function () { var decode = window.decodeURIComponent, urlPaths = this.options.url.split('?'), @@ -97,10 +100,18 @@ define([ return params; }, + /** + * @returns {String} + * @private + */ getCurrentLimit: function () { return this.getUrlParams()[this.options.limit] || this.options.limitDefault; }, + /** + * @returns {String} + * @private + */ getCurrentPage: function () { return this.getUrlParams()[this.options.page] || 1; }, @@ -118,7 +129,7 @@ define([ form, params, key, input, formKey, newPage; if (currentPage > 1 && paramName === this.options.limit) { - newPage = Math.floor(this.getCurrentLimit() * (currentPage-1) / paramValue) + 1; + newPage = Math.floor(this.getCurrentLimit() * (currentPage - 1) / paramValue) + 1; if (newPage > 1) { paramData[this.options.page] = newPage;