Skip to content

Commit

Permalink
#297 ensure document ready before resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Jun 13, 2016
1 parent e76a303 commit 0600605
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ The parentIFrame methods object in the iFrame is now always available and the `e

## Version History

* v3,5.4 [#362](https://github.com/davidjbradshaw/iframe-resizer/issues/362) Handle jQuery being loaded in odd ways.
* v3,5.4 [#362](https://github.com/davidjbradshaw/iframe-resizer/issues/362) Handle jQuery being loaded in odd ways. [#297](Ettps://github.com/davidjbradshaw/iframe-resizer/issues/297) Ensure document ready before resizing
* 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)].
Expand Down
19 changes: 14 additions & 5 deletions src/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,12 +954,21 @@
}

function initFromParent(){
initMsg = event.data;
target = event.source;
function fireInit(){
initMsg = event.data;
target = event.source;

init();
firstRun = false;
setTimeout(function(){ initLock = false;},eventCancelTimer);
init();
firstRun = false;
setTimeout(function(){ initLock = false;},eventCancelTimer);
}

if (document.body){
fireInit();
} else {
log('Waiting for page ready');
addEventListener(window,'readystatechange',initFromParent);
}
}

function resetFromParent(){
Expand Down

0 comments on commit 0600605

Please sign in to comment.