diff --git a/README.md b/README.md index 4269f7d..e42ae99 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ Exchange `latest` with the specific version number if you want to lock it in. * bLazy is AMD compatible. ## CHANGELOG +### v 1.2.2 (2014/05/04) ### +* Fixed [#15](https://github.com/dinbror/blazy/issues/15), when you resize the browser window in another tab bLazy didn't trigger new images in view. Thanks joshribakoff. + ### v 1.2.1 (2014/03/23) ### * When lazy loading background images it now only updates the background-image css attribute. Thanks Saku. diff --git a/blazy.js b/blazy.js index bd71568..9d26d69 100644 --- a/blazy.js +++ b/blazy.js @@ -1,5 +1,5 @@ /*! - hey, [be]Lazy.js - v1.2.1 - 2014.03.23 + hey, [be]Lazy.js - v1.2.2 - 2014.05.04 A lazy loading and multi-serving image script (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy */ @@ -102,9 +102,9 @@ bindEvent(object, 'scroll', validateT); }); } + bindEvent(window, 'resize', saveWinOffsetT); + bindEvent(window, 'resize', validateT); bindEvent(window, 'scroll', validateT); - bindEvent(window, 'resize', validateT); - bindEvent(window, 'resize', saveWinOffsetT); } // And finally, we start to lazy load. Should bLazy ensure domready? validate(); diff --git a/blazy.min.js b/blazy.min.js index 4b62313..3920598 100644 --- a/blazy.min.js +++ b/blazy.min.js @@ -1,6 +1,6 @@ /*! - hey, [be]Lazy.js - v1.2.1 - 2014.03.23 + hey, [be]Lazy.js - v1.2.2 - 2014.05.04 A lazy loading and multi-serving image script (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy */ -(function(e){"function"===typeof define&&define.amd?define(e):window.Blazy=e()})(function(){function e(b){if(!document.querySelectorAll){var f=document.createStyleSheet();document.querySelectorAll=function(b,a,e,c,g){g=document.all;a=[];b=b.replace(/\[for\b/gi,"[htmlFor").split(",");for(e=b.length;e--;){f.addRule(b[e],"k:v");for(c=g.length;c--;)g[c].currentStyle.k&&a.push(g[c]);f.removeRule(0)}return a}}k=!0;g=[];a=b||{};a.error=a.error||!1;a.offset=a.offset||100;a.success=a.success||!1;a.selector=a.selector||".b-lazy";a.separator=a.separator||"|";a.container=a.container?document.querySelectorAll(a.container):!1;a.errorClass=a.errorClass||"b-error";a.breakpoints=a.breakpoints||!1;a.successClass=a.successClass||"b-loaded";a.src=p=a.src||"data-src";r=1=window.screen.width)return p=b.src,!1});v()}function v(){y(a.selector);k&&(k=!1,a.container&&l(a.container,function(b){m(b,"scroll",c)}),m(window,"scroll",c),m(window,"resize",c),m(window,"resize",q));t()}function t(){for(var b=0;b=0-a.offset)||-1!==(" "+f.className+" ").indexOf(" "+a.successClass+" "))e.prototype.load(f),g.splice(b,1),h--,b--}0===h&&e.prototype.destroy()}function z(b){if(0=window.screen.width)return p=b.src,!1});v()}function v(){y(a.selector);k&&(k=!1,a.container&&l(a.container,function(b){m(b,"scroll",c)}),m(window,"resize",q),m(window,"resize",c),m(window,"scroll",c));t()}function t(){for(var b=0;b=0-a.offset)||-1!==(" "+f.className+" ").indexOf(" "+a.successClass+" "))e.prototype.load(f),g.splice(b,1),h--,b--}0===h&&e.prototype.destroy()}function z(b){if(0