From: Brion Vibber Date: Fri, 7 Jan 2011 00:36:57 +0000 (-0800) Subject: Fix regression in last year's update of InfiniteScroll -- having debug off caused... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f97380fdb5c03557fc01ee8301f4c558e916d374;p=quix0rs-gnu-social.git Fix regression in last year's update of InfiniteScroll -- having debug off caused breakage due to bad code interpreting every variable as a selector, and jQuery then failing when passed 'false'. Note that the current version of the infinitescroll jquery plugin fixes this, but I'm not updating to it because the code's been altered from the upstream version, apparently to stop it from actually working as infinite scroll. WTF? :) --- diff --git a/plugins/InfiniteScroll/jquery.infinitescroll.js b/plugins/InfiniteScroll/jquery.infinitescroll.js index ec31bb0863..dd61f8b18a 100644 --- a/plugins/InfiniteScroll/jquery.infinitescroll.js +++ b/plugins/InfiniteScroll/jquery.infinitescroll.js @@ -21,7 +21,7 @@ // grab each selector option and see if any fail. function areSelectorsValid(opts){ for (var key in opts){ - if (key.indexOf && key.indexOf('Selector') && $(opts[key]).length === 0){ + if (key.indexOf && (key.indexOf('Selector') != -1) && $(opts[key]).length === 0){ debug('Your ' + key + ' found no elements.'); return false; }