Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Moved innerheight into picturefill function
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Kos committed Oct 14, 2014
1 parent be2cd09 commit e9d9ac1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions betty/cropper/templates/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
ASPECT_RATIO_TOLERANCE = .1, // 10% tolerance.
breakpoints = [{{ BETTY_WIDTHS|join:","}}];
w.innerHeight = w.innerHeight || w.document.documentElement.clientHeight;
w.picturefill = function(elements, forceRerender) {
// get elements to picturefill
Expand All @@ -33,7 +31,8 @@
}
// check if image is in viewport for lazy loading
var visible = el.getBoundingClientRect().top <= w.innerHeight;
var innerHeight = w.innerHeight || w.document.documentElement.clientHeight,
visible = el.getBoundingClientRect().top <= innerHeight;
// this is a div to picturefill, start working on it if it hasn't been rendered yet
if (el.getAttribute("data-image-id") !== null
Expand Down

0 comments on commit e9d9ac1

Please sign in to comment.