From 0e692c966f8f3937b490949aa9d04b103a22b612 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Apr 2011 13:19:49 +0200 Subject: [PATCH] Add method to get the current page of a pagination. --- src/main/resources/static/javascript/sone.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 7c3a064..db08197 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -1115,6 +1115,17 @@ function isIndexPage() { } /** + * Returns the current page of the selected pagination. + * + * @param paginationSelector + * The pagination selector + * @returns The current page of the pagination + */ +function getPage(paginationSelector) { + return $(".current-page", paginationSelector).text(); +} + +/** * Returns whether the current page is a “view Sone” page. * * @returns {Boolean} true if the current page is a “view Sone” -- 2.7.4