From ae246815d9288a6af9b4c5884d38ab42de69b129 Mon Sep 17 00:00:00 2001 From: Jesus Dugarte Date: Wed, 17 Aug 2016 09:01:02 -0400 Subject: [PATCH 1/3] replace .size() with .length --- app/assets/javascripts/jquery.infinite-pages.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/jquery.infinite-pages.js.coffee b/app/assets/javascripts/jquery.infinite-pages.js.coffee index 74efbfd..a1a4f4d 100644 --- a/app/assets/javascripts/jquery.infinite-pages.js.coffee +++ b/app/assets/javascripts/jquery.infinite-pages.js.coffee @@ -58,7 +58,7 @@ Released under the MIT License # load event if close enough check: -> nav = @$container.find(@options.navSelector) - if nav.size() == 0 + if nav.length == 0 @_log "No more pages to load" else windowBottom = @$context.scrollTop() + @$context.height() From 807a3505afa1a07b03d2353d69af6d92c29dd97f Mon Sep 17 00:00:00 2001 From: Jesus Dugarte Date: Fri, 19 Apr 2019 15:13:39 -0400 Subject: [PATCH 2/3] add backwards compatibility --- app/assets/javascripts/jquery.infinite-pages.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/jquery.infinite-pages.js.coffee b/app/assets/javascripts/jquery.infinite-pages.js.coffee index a1a4f4d..5abfabd 100644 --- a/app/assets/javascripts/jquery.infinite-pages.js.coffee +++ b/app/assets/javascripts/jquery.infinite-pages.js.coffee @@ -58,7 +58,7 @@ Released under the MIT License # load event if close enough check: -> nav = @$container.find(@options.navSelector) - if nav.length == 0 + if (typeof nav.size == 'function' ? nav.size() : nav.length) == 0 @_log "No more pages to load" else windowBottom = @$context.scrollTop() + @$context.height() From 704a8d9a2f1d0af5dab528fb85301d56059114d0 Mon Sep 17 00:00:00 2001 From: Jesus Dugarte Date: Fri, 19 Apr 2019 16:09:01 -0400 Subject: [PATCH 3/3] fix condition --- app/assets/javascripts/jquery.infinite-pages.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/jquery.infinite-pages.js.coffee b/app/assets/javascripts/jquery.infinite-pages.js.coffee index 5abfabd..f8a3f98 100644 --- a/app/assets/javascripts/jquery.infinite-pages.js.coffee +++ b/app/assets/javascripts/jquery.infinite-pages.js.coffee @@ -58,7 +58,7 @@ Released under the MIT License # load event if close enough check: -> nav = @$container.find(@options.navSelector) - if (typeof nav.size == 'function' ? nav.size() : nav.length) == 0 + if (if typeof nav.size == 'function' then nav.size() else nav.length) == 0 @_log "No more pages to load" else windowBottom = @$context.scrollTop() + @$context.height()