|
|
|
@ -17,7 +17,7 @@ |
|
|
|
|
factory(jQuery); |
|
|
|
|
} |
|
|
|
|
}(function ($) { |
|
|
|
|
$.frameReady = function (callback, targetSelector, resources) { |
|
|
|
|
$.frameReady = function (callback, targetSelector, resources, conditional) { |
|
|
|
|
/** |
|
|
|
|
* @type {window} |
|
|
|
|
*/ |
|
|
|
@ -59,8 +59,17 @@ |
|
|
|
|
targetWindow.onload = function () { |
|
|
|
|
scripsLoadedCount = 0; |
|
|
|
|
|
|
|
|
|
if (typeof conditional === 'function' && conditional()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
targetDocument = targetWindow.contentDocument; |
|
|
|
|
|
|
|
|
|
if (!targetDocument) { |
|
|
|
|
console.log('frameReady: Can\'t access to contentDocument.'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
scripts.forEach(function (script) { |
|
|
|
|
createScript(script); |
|
|
|
|
}); |
|
|
|
|