Skip to content

Commit

Permalink
#362 better handle jQuery loading in odd ways
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Jun 13, 2016
1 parent 1d61152 commit e76a303
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ The parentIFrame methods object in the iFrame is now always available and the `e

## Version History

* v3.5.3 [#283](https://github.com/davidjbradshaw/iframe-resizer/issues/286) Added *readystatechange* event listener.
* v3,5.4 [#362](https://github.com/davidjbradshaw/iframe-resizer/issues/362) Handle jQuery being loaded in odd ways.
* v3.5.3 [#283](https://github.com/davidjbradshaw/iframe-resizer/issues/283) Added *readystatechange* event listener.
* v3.5.2 [#314](https://github.com/davidjbradshaw/iframe-resizer/pull/314) Add iframeHeight and iframeWidth properties to pageInfo [[Pierre Olivier](https://github.com/pomartel)]. [#303](https://github.com/davidjbradshaw/iframe-resizer/issues/303) Fix issue with IE8 polyFils.
* v3.5.1 [#286](https://github.com/davidjbradshaw/iframe-resizer/issues/286) Fixed *taggedElement / lowestElement / rightMostElement* to calculate correct margin [[Dan Ballance](danballance)].
* v3.5.0 Recall getPageInfo callback when parent page position changes. Added *Array.prototype.forEach* to IE8 polyfils.
Expand Down
2 changes: 1 addition & 1 deletion js/iframeResizer.contentWindow.min.js

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

16 changes: 11 additions & 5 deletions js/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,17 @@
}

function createJQueryPublicMethod($){
$.fn.iFrameResize = function $iFrameResizeF(options) {
return this.filter('iframe').each(function (index, element) {
setupIFrame(element, options);
}).end();
};
if (!$.fn) {
info('','Unable to bind to jQuery, it is not fully loaded.');
} else {
$.fn.iFrameResize = function $iFrameResizeF(options) {
function init(index, element) {
setupIFrame(element, options);
}

return this.filter('iframe').each(init).end();
};
}
}

if (window.jQuery) { createJQueryPublicMethod(jQuery); }
Expand Down
2 changes: 1 addition & 1 deletion js/iframeResizer.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/iframeResizer.min.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions src/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,17 @@
}

function createJQueryPublicMethod($){
$.fn.iFrameResize = function $iFrameResizeF(options) {
return this.filter('iframe').each(function (index, element) {
setupIFrame(element, options);
}).end();
};
if (!$.fn) {
info('','Unable to bind to jQuery, it is not fully loaded.');
} else {
$.fn.iFrameResize = function $iFrameResizeF(options) {
function init(index, element) {
setupIFrame(element, options);
}

return this.filter('iframe').each(init).end();
};
}
}

if (window.jQuery) { createJQueryPublicMethod(jQuery); }
Expand Down

0 comments on commit e76a303

Please sign in to comment.