Add method to get the current page of a pagination.
[Sone.git] / src / main / resources / static / javascript / sone.js
index 7c3a064..db08197 100644 (file)
@@ -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} <code>true</code> if the current page is a “view Sone”