From 342afb26a16ea02b5a09d8e6a1de077a7ea09004 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 10 Feb 2019 11:12:20 +0530 Subject: [PATCH 1/4] fixed-pagination-issue-admin-review-grid --- lib/web/mage/adminhtml/grid.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index c9af869d79161..b16b2c9defce0 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -531,12 +531,19 @@ define([ /** * @param {Object} event */ - inputPage: function (event) { + inputPage: function (event, lastId) { var element = Event.element(event), - keyCode = event.keyCode || event.which; + keyCode = event.keyCode || event.which, + enteredValue = parseInt(element.value), + lastId = parseInt(lastId); + if (keyCode == Event.KEY_RETURN) { //eslint-disable-line eqeqeq - this.setPage(element.value); + if (enteredValue > lastId) { + this.setPage(lastId); + } else { + this.setPage(element.value); + } } /*if(keyCode>47 && keyCode<58){ From 36ebc6542767c48c6f939e1fe1fe0f0faf2949f2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 10 Feb 2019 11:27:50 +0530 Subject: [PATCH 2/4] fixed-pagination-issue-admin-review-grid --- lib/web/mage/adminhtml/grid.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index b16b2c9defce0..b7e696ae8f4bd 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -530,6 +530,7 @@ define([ /** * @param {Object} event + * @param int lastId */ inputPage: function (event, lastId) { var element = Event.element(event), From 5392ee7a7d7d10dd61d5c712d9a23304830445e9 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 10 Feb 2019 11:31:49 +0530 Subject: [PATCH 3/4] fixed-pagination-issue-admin-review-grid-clean-code --- lib/web/mage/adminhtml/grid.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index b7e696ae8f4bd..e27dd9c2a0d26 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -538,12 +538,11 @@ define([ enteredValue = parseInt(element.value), lastId = parseInt(lastId); - if (keyCode == Event.KEY_RETURN) { //eslint-disable-line eqeqeq if (enteredValue > lastId) { this.setPage(lastId); } else { - this.setPage(element.value); + this.setPage(enteredValue); } } From 73b57d441f2a5494098c112482fe9316d802fb99 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Mon, 25 Feb 2019 16:00:48 +0200 Subject: [PATCH 4/4] Fix static tests. --- lib/web/mage/adminhtml/grid.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js index e27dd9c2a0d26..5f7a709f04fea 100644 --- a/lib/web/mage/adminhtml/grid.js +++ b/lib/web/mage/adminhtml/grid.js @@ -530,17 +530,17 @@ define([ /** * @param {Object} event - * @param int lastId + * @param {*} lastId */ inputPage: function (event, lastId) { var element = Event.element(event), keyCode = event.keyCode || event.which, - enteredValue = parseInt(element.value), - lastId = parseInt(lastId); + enteredValue = parseInt(element.value, 10), + pageId = parseInt(lastId, 10); if (keyCode == Event.KEY_RETURN) { //eslint-disable-line eqeqeq - if (enteredValue > lastId) { - this.setPage(lastId); + if (enteredValue > pageId) { + this.setPage(pageId); } else { this.setPage(enteredValue); }