Skip to content

Commit a0ac5ef

Browse files
committed
Restore jquery.frameready.js code from 1.11.x - refs BT#21508
1 parent 66f6fcd commit a0ac5ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

public/main/inc/lib/javascript/jquery.frameready.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
factory(jQuery);
1818
}
1919
}(function ($) {
20-
$.frameReady = function (callback, targetSelector, resources) {
20+
$.frameReady = function (callback, targetSelector, resources, conditional) {
2121
/**
2222
* @type {window}
2323
*/
@@ -59,8 +59,17 @@
5959
targetWindow.onload = function () {
6060
scripsLoadedCount = 0;
6161

62+
if (typeof conditional === 'function' && conditional()) {
63+
return;
64+
}
65+
6266
targetDocument = targetWindow.contentDocument;
6367

68+
if (!targetDocument) {
69+
console.log('frameReady: Can\'t access to contentDocument.');
70+
return;
71+
}
72+
6473
scripts.forEach(function (script) {
6574
createScript(script);
6675
});

0 commit comments

Comments
 (0)