mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+8
-2
@@ -911,8 +911,14 @@ kit.config = kit.config || {};
|
||||
context = context || this;
|
||||
if (/complete|interactive|loaded/.test(document.readyState)) {
|
||||
promise = new Promise(function(resolve, reject){
|
||||
fn.apply(context, args);
|
||||
resolve();
|
||||
let result = fn.apply(context, args);
|
||||
if (result && typeof result.then === 'function' && result instanceof Promise) {
|
||||
result.then(function(){
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
promise = new Promise(function(resolve, reject){
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user