Skip to content

Commit

Permalink
Static Tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz committed Feb 28, 2020
1 parent 51a18f6 commit 0bae5d5
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ define([
);
},

/**
* @private
*/
getUrlParams: function () {
var decode = window.decodeURIComponent,
urlPaths = this.options.url.split('?'),
Expand All @@ -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;
},
Expand All @@ -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;
Expand Down

0 comments on commit 0bae5d5

Please sign in to comment.