From f3e36b896b9865395859a6b868ac0996917c4db7 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Wed, 25 Sep 2013 09:45:51 -0700 Subject: [PATCH] Merge pull request #746 from Mainmich/patch-1 [-] MO : Blocklayered Fix pagination incompatibility --- modules/blocklayered/blocklayered.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/blocklayered/blocklayered.js b/modules/blocklayered/blocklayered.js index 5eaffb4a2..0edae4fd8 100644 --- a/modules/blocklayered/blocklayered.js +++ b/modules/blocklayered/blocklayered.js @@ -230,11 +230,11 @@ function initLayered() function paginationButton() { $('#pagination a').not(':hidden').each(function () { - if ($(this).attr('href').search('&p=') == -1) { + if ($(this).attr('href').search(/&|\?p=/) == -1) { var page = 1; } else { - var page = $(this).attr('href').replace(/^.*&p=(\d+).*$/, '$1'); + var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1'); } var location = window.location.href.replace(/#.*$/, ''); $(this).attr('href', location+current_friendly_url.replace(/\/page-(\d+)/, '')+'/page-'+page);