npr/responsiveiframe — pull request #13 by acmcelwee (2013-08-15 23:45:12+00:00)
Title: Child now correctly sends new size. AMD/CommonJS/window export support.

Previously, `messageParent` was the event handler, but it was consuming the event as the `scrollTop` argument. I've fixed that so there's an intermediate event handler that then calls `messageParent`.

Also, the `resize` and `onresize` events were subscribed to, but that isn't an event that would fire when the content size in the iframe changes. You have to resort to polling for this change, so I've added the polling with a tuneable polling interval.

I've also patched up the CommonJS support and added AMD support. Previously, there was a `module` variable declared in the same scope where the the `module.exports` call was happening.

Finally, the child embed page now has the option to only force a frame resize on content size changes, rather than on content size changes AND the initial load. I see the common use where the initial size is known, but over time, the dynamic content changes require a resize of the container.