Skip to content

Commit 1434ac1

Browse files
committed
launch success callback even when all scripts have already been loaded already
1 parent 7106e18 commit 1434ac1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stackload.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@
112112
}
113113
});
114114
var cL=cleanedStack.length;
115+
if (typeof stack.success !== 'function') {
116+
stack.success = function(){};
117+
}
115118
if(cL>0){
116119
fullStack = fullStack.concat(cleanedStack);
117120
var fL = fullStack.length;
118-
if (typeof stack.success !== 'function') {
119-
stack.success = function(){};
120-
}
121121
if (typeof stack.error !== 'function') {
122122
stack.error = function(){};
123123
}
@@ -129,6 +129,8 @@
129129
if(currentLoadIndex===fL-cL){
130130
loadSingle();
131131
}
132+
} else {
133+
stack.success();
132134
}
133135
}
134136
}

stackload.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)