aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js25
-rw-r--r--phpBB/styles/prosilver/template/pagination.html13
2 files changed, 19 insertions, 19 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index ebdb843a38..3eadad59f9 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -25,12 +25,12 @@ function popup(url, width, height, name) {
/**
* Jump to page
*/
-function jumpto(form) {
+function jumpto(item) {
- var page = $(form).find("input[name='page-number']").val(),
- per_page = $(form).find("input[name='per-page']").val(),
- base_url = $(form).find("input[name='base-url']").val(),
- start_name = $(form).find("input[name='start-name']").val();
+ var page = item.val(),
+ per_page = item.attr('data-per-page'),
+ base_url = item.attr('data-base-url'),
+ start_name = item.attr('data-start-name');
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) {
if (base_url.indexOf('?') === -1) {
@@ -355,11 +355,18 @@ function parse_document(container)
/**
* Pagination
*/
- container.find('form.page-jump-form').submit(function(event) {
- event.preventDefault();
- jumpto($(this));
+ container.find('.pagination .page-jump-form :button').click(function() {
+ $input = $(this).siblings("input[name='page-number']");
+ jumpto($input);
});
-
+
+ container.find(".pagination .page-jump-form input[name='page-number']").on("keypress", function(event) {
+ if (event.which == 13 || event.keyCode == 13) {
+ event.preventDefault();
+ jumpto($(this));
+ }
+ });
+
container.find('.pagination-trigger').click(function() {
$container = $(this).parent();
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
index 26bf3d88ab..6e2e02b31a 100644
--- a/phpBB/styles/prosilver/template/pagination.html
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -6,16 +6,9 @@
<div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents">
<li>{L_JUMP_TO_PAGE_FORM}</li>
- <li>
- <form class="page-jump-form" method="get">
- <fieldset>
- <input type="text" name="page-number" maxlength="6" title="{L_SEARCH_KEYWORDS}" class="inputbox tiny" value="" />
- <input class="button2" value="{L_GO}" type="submit" />
- <input type="hidden" value="{PER_PAGE}" name="per-page">
- <input type="hidden" value="{START_NAME}" name="start-name">
- <input type="hidden" value="{BASE_URL|e('html_attr')}" name="base-url">
- </fieldset>
- </form>
+ <li class="page-jump-form">
+ <input type="text" name="page-number" maxlength="6" title="{L_SEARCH_KEYWORDS}" class="inputbox tiny" value="" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
+ <input class="button2" value="{L_GO}" type="button" />
</li>
</ul>
</div>