Skip to content

Commit

Permalink
launch success callback even when all scripts have already been loade…
Browse files Browse the repository at this point in the history
…d already
  • Loading branch information
lubber-de committed Oct 16, 2017
1 parent 7106e18 commit 1434ac1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions stackload.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
}
});
var cL=cleanedStack.length;
if (typeof stack.success !== 'function') {
stack.success = function(){};
}
if(cL>0){
fullStack = fullStack.concat(cleanedStack);
var fL = fullStack.length;
if (typeof stack.success !== 'function') {
stack.success = function(){};
}
if (typeof stack.error !== 'function') {
stack.error = function(){};
}
Expand All @@ -129,6 +129,8 @@
if(currentLoadIndex===fL-cL){
loadSingle();
}
} else {
stack.success();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion stackload.min.js

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

0 comments on commit 1434ac1

Please sign in to comment.