Skip to content

Commit e23038a

Browse files
committed
Fix case url not exist param
1 parent 1e999a8 commit e23038a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

view/frontend/web/js/plugin/infinitescroll.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ IASCallbacks.prototype = {
171171
*
172172
* Copyright 2014 Webcreate (Jeroen Fiege)
173173
*/
174-
define([
175-
'jquery'
176-
], function () {
177174
(function($) {
178175

179176
'use strict';
@@ -316,7 +313,7 @@ define([
316313
// always take the last matching item
317314
var next_url = $(this.nextSelector, container).last().attr('href');
318315
if(typeof(next_url) != 'undefined') {
319-
next_url += '&ajaxscroll=1';
316+
next_url += next_url.includes('?') ? '&ajaxscroll=1' : '?ajaxscroll=1';
320317
} else {
321318
next_url = '';
322319
}
@@ -746,7 +743,6 @@ define([
746743
negativeMargin: 10
747744
};
748745
})(jQuery);
749-
});
750746
if(typeof(IASHistoryExtension) == "undefined"){
751747
/**
752748
* IAS History Extension
@@ -816,7 +812,7 @@ var IASHistoryExtension = function (options) {
816812
// always take the last matching item
817813
var prev_url = jQuery(this.prevSelector, container).last().attr('href');
818814
if(typeof(prev_url) != 'undefined') {
819-
prev_url += '&ajaxscroll=1';
815+
prev_url += prev_url.includes('?') ? '&ajaxscroll=1' : '?ajaxscroll=1';
820816
} else {
821817
prev_url = '';
822818
}

0 commit comments

Comments
 (0)