From c8f0d6b1d63e21843fc13c1b131f4b89cd36b71b Mon Sep 17 00:00:00 2001 From: Isaac Bythewood Date: Fri, 5 Apr 2013 18:30:14 +0000 Subject: [PATCH] Fix bug of multiple of same images loading sometimes --- pinry/static/js/pinry.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pinry/static/js/pinry.js b/pinry/static/js/pinry.js index ca05c7d..210f83c 100644 --- a/pinry/static/js/pinry.js +++ b/pinry/static/js/pinry.js @@ -2,7 +2,7 @@ * Pinry * Descrip: Core of pinry, loads and tiles pins. * Authors: Pinry Contributors - * Updated: Mar 3rd, 2013 + * Updated: Apr 5th, 2013 * Require: jQuery, Pinry JavaScript Helpers */ @@ -154,9 +154,11 @@ $(window).load(function() { }) // If we scroll to the bottom of the document load more pins - $(window).scroll(function() { - var windowPosition = $(window).scrollTop() + $(window).height(); - var bottom = $(document).height() - 100; - if(windowPosition > bottom) loadPins(); + $(window).ajaxStop(function() { + $(window).scroll(function() { + var windowPosition = $(window).scrollTop() + $(window).height(); + var bottom = $(document).height() - 100; + if(windowPosition > bottom) loadPins(); + }); }); });