diff options
| author | Cesar G <prototech91@gmail.com> | 2014-06-14 16:31:20 -0700 |
|---|---|---|
| committer | Cesar G <prototech91@gmail.com> | 2014-06-14 16:31:20 -0700 |
| commit | b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e (patch) | |
| tree | 1d23e62d4b118a1dc71c1469d92fcf7a9dffbbf3 /phpBB/styles/prosilver/template/forum_fn.js | |
| parent | 73718175673540fb8c5cfd07fe4e26761d7c3516 (diff) | |
| parent | 24bbd06d49a5d80fccfe37e98fd7786d4bda2807 (diff) | |
| download | forums-b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e.tar forums-b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e.tar.gz forums-b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e.tar.bz2 forums-b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e.tar.xz forums-b0ab83886e730fb9d31b3247ffb9ea4758cc1b1e.zip | |
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: (25 commits)
[ticket/12613] Add distinction between top/bottom action-bar
[ticket/12613] Replaced topic-actions with action-bar
[ticket/12613] Remove responsive linklist from memberlist
[ticket/12613] Remove unnecessary checks and clean up CSS
[ticket/12613] role="navigation" not allowed on <ul>
[ticket/12613] Improved screen reader functionality
[ticket/12613] Removed unnecessary checks
[ticket/12613] Set fixed font-size
[ticket/12613] Slightly better icons
[ticket/12613] Typo and L_COLON
[ticket/12613] Small inconsistency fixes
[ticket/12613] Don't display page-jump if all pages are visible (6)
[ticket/12613] Fixes from comments (single quotes and typos)
[ticket/12613] Minor $bull; and <hr> fix
[ticket/12613] Pagination should never be in responsive linklist
[ticket/12613] Minor CSS fixes
[ticket/12613] Dropdown-visible page-jump icon, fix focus() timing
[ticket/12613] Renamed jump-to to page-jump to prevent confusion
[ticket/12613] Removed form in order to prevent nested forms
[ticket/12613] Fix functional test and post sorting bug
...
Diffstat (limited to 'phpBB/styles/prosilver/template/forum_fn.js')
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index fa838fde19..3d42439c1d 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -25,20 +25,12 @@ function popup(url, width, height, name) { /** * Jump to page */ -function jumpto(item) { - if (!item || !item.length) { - item = $('a.pagination-trigger[data-lang-jump-page]'); - if (!item.length) { - return; - } - } +function pageJump(item) { - var jump_page = item.attr('data-lang-jump-page'), - on_page = item.attr('data-on-page'), + 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'), - page = prompt(jump_page, on_page); + start_name = item.attr('data-start-name'); if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { if (base_url.indexOf('?') === -1) { @@ -363,8 +355,26 @@ function parse_document(container) /** * Pagination */ - container.find('a.pagination-trigger').click(function() { - jumpto($(this)); + container.find('.pagination .page-jump-form :button').click(function() { + $input = $(this).siblings('input.inputbox'); + pageJump($input); + }); + + container.find('.pagination .page-jump-form input.inputbox').on('keypress', function(event) { + if (event.which == 13 || event.keyCode == 13) { + event.preventDefault(); + pageJump($(this)); + } + }); + + container.find('.pagination .dropdown-trigger').click(function() { + $dropdown_container = $(this).parent(); + // Wait a little bit to make sure the dropdown has activated + setTimeout(function() { + if ($dropdown_container.hasClass('dropdown-visible')) { + $dropdown_container.find('input.inputbox').focus(); + } + },100); }); /** |
