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
*
* (c) sgalinski Internet Services (http://www.sgalinski.de)
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
......@@ -45,12 +45,12 @@ SG.ElementScrollBrowser.prototype = {
resultList: null,
/**
* @var string
* @var string|null
*/
url: null,
/**
* @var string
* @var string|null
*/
lastUrl: null,
......@@ -75,7 +75,9 @@ SG.ElementScrollBrowser.prototype = {
this.url = $('.tx-pagebrowse-next a').attr('href');
$(window).on(
'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;
}
......
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