Skip to content
Snippets Groups Projects
Commit a3dfdddb authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[BUGFIX] Fix warnings in the endless scroll script

parent 89ca86fa
No related branches found
No related tags found
No related merge requests found
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
* (c) sgalinski Internet Services (http://www.sgalinski.de) * (c) sgalinski Internet Services (https://www.sgalinski.de)
* *
* All rights reserved * All rights reserved
* *
...@@ -45,12 +45,12 @@ SG.ElementScrollBrowser.prototype = { ...@@ -45,12 +45,12 @@ SG.ElementScrollBrowser.prototype = {
resultList: null, resultList: null,
/** /**
* @var string * @var string|null
*/ */
url: null, url: null,
/** /**
* @var string * @var string|null
*/ */
lastUrl: null, lastUrl: null,
...@@ -75,7 +75,9 @@ SG.ElementScrollBrowser.prototype = { ...@@ -75,7 +75,9 @@ SG.ElementScrollBrowser.prototype = {
this.url = $('.tx-pagebrowse-next a').attr('href'); this.url = $('.tx-pagebrowse-next a').attr('href');
$(window).on( $(window).on(
'scroll', function() { 'scroll', function() {
if (this.lock || !this.checkPosition() || this.url === undefined || this.url === this.lastUrl) { var recordLockedOrNotInPosition = this.lock || !this.checkPosition();
var urlIsInvalid = typeof this.url === 'undefined' || this.url === this.lastUrl;
if (recordLockedOrNotInPosition || urlIsInvalid) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment