From: David ‘Bombe’ Roden Date: Sat, 16 Apr 2011 11:19:49 +0000 (+0200) Subject: Add method to get the current page of a pagination. X-Git-Tag: 0.6.2^2~11^2~2 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=0e692c966f8f3937b490949aa9d04b103a22b612 Add method to get the current page of a pagination. --- 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”