Add pagination info service
Change-Id: I462f05581256575e9b52f474515cb8cb5e533d3b
diff --git a/dev/js/src/plugin/server.js b/dev/js/src/plugin/server.js
index 817c0c9..d5295f7 100644
--- a/dev/js/src/plugin/server.js
+++ b/dev/js/src/plugin/server.js
@@ -9,7 +9,7 @@
*/
"use strict";
-define(['plugin/widget', 'plugin/service', 'state', 'util'], function (widgetClass, serviceClass, stateClass) {
+define(['plugin/widget', 'plugin/service', 'state', 'pageInfo', 'util'], function (widgetClass, serviceClass, stateClass, pageInfoClass) {
KorAP.Panel = KorAP.Panel || {};
@@ -475,7 +475,7 @@
};
}
- // Get Query information from from
+ // Get Query information from form
else if (d.key == 'QueryForm') {
let doc = document;
let v = d["value"] = {};
@@ -502,6 +502,15 @@
v["q"] = p.get('q');
v["ql"] = p.get('ql');
v["cq"] = p.get('cq');
+ }
+
+ // Get pagination information
+ else if (d.key == 'Pagination') {
+ const pi = pageInfoClass.create();
+ let v = d["value"] = {};
+ v["page"] = pi.page();
+ v["total"] = pi.total();
+ v["count"] = pi.count();
};
// data needs to be mirrored