mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 19:54:12 +02:00
[ticket/11795] Get rid of pagination JS variables
Move pagination variables to data attributes Replace A_BASE_URL with BASE_URL and use TWIG to escape it PHPBB3-11795
This commit is contained in:
@@ -25,8 +25,19 @@ function popup(url, width, height, name) {
|
||||
/**
|
||||
* Jump to page
|
||||
*/
|
||||
function jumpto() {
|
||||
var page = prompt(jump_page, on_page);
|
||||
function jumpto(item) {
|
||||
if (!item || !item.length) {
|
||||
item = $('a.pagination-trigger[data-lang-jump-page]');
|
||||
if (!item.length) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var jump_page = item.attr('data-lang-jump-page'),
|
||||
on_page = item.attr('data-on-page'),
|
||||
per_page = item.attr('data-per-page'),
|
||||
base_url = item.attr('data-base-url'),
|
||||
page = prompt(jump_page, on_page);
|
||||
|
||||
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) {
|
||||
if (base_url.indexOf('?') === -1) {
|
||||
@@ -307,6 +318,11 @@ jQuery(document).ready(apply_onkeypress_event);
|
||||
$(this.getAttribute('data-reset-on-edit')).val('');
|
||||
});
|
||||
|
||||
// Pagination
|
||||
$('a.pagination-trigger').click(function() {
|
||||
jumpto($(this));
|
||||
});
|
||||
|
||||
// Adjust HTML code for IE8 and older versions
|
||||
var test = document.createElement('div'),
|
||||
oldBrowser = (typeof test.style.borderRadius == 'undefined');
|
||||
|
Reference in New Issue
Block a user