Skip to content

Commit

Permalink
3.0.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.farkas committed Nov 28, 2016
1 parent 8c95208 commit ffb23cf
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
minified: {
options: {
maxBytes: (1024 * 6.433)
maxBytes: (1024 * 6.333)
},
src: ["lazysizes.min.js"]
}
Expand Down
31 changes: 18 additions & 13 deletions lazysizes-umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,28 @@
var rAF = (function(){
var running, waiting;
var fns = [];
var secondFns = [];

var run = function(){
var fn;
var runFns = fns;

fns = secondFns;

running = true;
waiting = false;
while(fns.length){
fn = fns.shift();
fn[0].apply(fn[1], fn[2]);

while(runFns.length){
runFns.shift()();
}

running = false;
};

var rafBatch = function(fn){
if(running){
var rafBatch = function(fn, queue){
if(running && !queue){
fn.apply(this, arguments);
} else {
fns.push([fn, this, arguments]);
fns.push(fn);

if(!waiting){
waiting = true;
Expand Down Expand Up @@ -445,12 +450,12 @@
}
}

rAF(function(){
if(elem._lazyRace){
delete elem._lazyRace;
}
removeClass(elem, lazySizesConfig.lazyClass);
if(elem._lazyRace){
delete elem._lazyRace;
}
removeClass(elem, lazySizesConfig.lazyClass);

rAF(function(){
if( !firesLoad || elem.complete ){
if(firesLoad){
resetPreloading(event);
Expand All @@ -459,7 +464,7 @@
}
switchLoadingClass(event);
}
});
}, true);
});

var unveilElement = function (elem){
Expand Down
4 changes: 2 additions & 2 deletions lazysizes-umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions lazysizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,28 @@
var rAF = (function(){
var running, waiting;
var fns = [];
var secondFns = [];

var run = function(){
var fn;
var runFns = fns;

fns = secondFns;

running = true;
waiting = false;
while(fns.length){
fn = fns.shift();
fn[0].apply(fn[1], fn[2]);

while(runFns.length){
runFns.shift()();
}

running = false;
};

var rafBatch = function(fn){
if(running){
var rafBatch = function(fn, queue){
if(running && !queue){
fn.apply(this, arguments);
} else {
fns.push([fn, this, arguments]);
fns.push(fn);

if(!waiting){
waiting = true;
Expand Down Expand Up @@ -443,12 +448,12 @@
}
}

rAF(function(){
if(elem._lazyRace){
delete elem._lazyRace;
}
removeClass(elem, lazySizesConfig.lazyClass);
if(elem._lazyRace){
delete elem._lazyRace;
}
removeClass(elem, lazySizesConfig.lazyClass);

rAF(function(){
if( !firesLoad || elem.complete ){
if(firesLoad){
resetPreloading(event);
Expand All @@ -457,7 +462,7 @@
}
switchLoadingClass(event);
}
});
}, true);
});

var unveilElement = function (elem){
Expand Down
Loading

0 comments on commit ffb23cf

Please sign in to comment.