From a862c4aaffde6240c13be7039c3ebff939755e56 Mon Sep 17 00:00:00 2001 From: yodathedark Date: Thu, 13 Mar 2014 13:11:16 +0000 Subject: [PATCH] Update jquery.jscroll.js Adding an extra check before loading to prevent JS warnings from undefined data objects, as these were racking up with every scroll I did after there was no more data to find. --- jquery.jscroll.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.jscroll.js b/jquery.jscroll.js index 829bdb7..b12e64e 100644 --- a/jquery.jscroll.js +++ b/jquery.jscroll.js @@ -99,7 +99,7 @@ innerTop = $inner.length ? $inner.offset().top : 0, iTotalHeight = Math.ceil(iTopHeight - innerTop + _$scroll.height() + iContainerTop); - if (!data.waiting && iTotalHeight + _options.padding >= $inner.outerHeight()) { + if (typeof(data) !== 'undefined' && !data.waiting && iTotalHeight + _options.padding >= $inner.outerHeight()) { //data.nextHref = $.trim(data.nextHref + ' ' + _options.contentSelector); _debug('info', 'jScroll:', $inner.outerHeight() - iTotalHeight, 'from bottom. Loading next request...'); return _load(); @@ -206,4 +206,4 @@ var jscroll = new jScroll($this, m); }); }; -})(jQuery); \ No newline at end of file +})(jQuery);