Sjerp van Wouden Posted September 2, 2015 Share Posted September 2, 2015 We're running presta 1.6.11. We ran into a problem of the bottom pagination being removed when a second page in the pagination was visited. In blocklayered.js various parts of the page are filled with new data upon completing the ajax request for the next page in pagination.We found out that the HTML used by the code, around line 500 of blocklayered.js, to replace the second aka bottom pagination is empty, thus causing the pagination to be removed. This is because jQuery objects, into which this HTML was put for calculation purposes by presta, cannot be inserted twice.The jQuery object used here is confusingly called 'data'.So a copy of this jQuery object was required for the insertation. The following function returns a jQuery clone of any jQuery object. function jqclone($el){ return $el.clone(); }Using this around line 530 solved the problem. if (data.find('ul.pagination').length) { $('div.pagination').show(); $('ul.pagination').each(function () { $(this).replaceWith(data.find('ul.pagination')); }); }became if (data.find('ul.pagination').length) { $('div.pagination').show(); $('ul.pagination').each(function () { $(this).replaceWith(jqclone(data.find('ul.pagination'))); }); }CheersSjerp van WoudenSite by Site Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now