Fix Issue #2823 - Ugly scrollbars in oembed iframes and broken resizing

- Fix _resizeIframe function, shorten the timeout between calls
- Simplify the oembed iframe generation code and reduce the minimum
iframe height to 200px
- Add smooth CSS transition for iframe resizing
This commit is contained in:
Hypolite Petovan 2016-09-30 23:26:22 -04:00
parent 9f17b925c6
commit 76b1b109e5
3 changed files with 30 additions and 25 deletions

View file

@ -5,17 +5,14 @@
function _resizeIframe(obj, desth) {
var h = obj.style.height;
var ch = obj.contentWindow.document.body.scrollHeight + 'px';
if (h==ch) {
var ch = obj.contentWindow.document.body.scrollHeight;
if (h == (ch + 'px')) {
return;
}
//console.log("_resizeIframe", obj, desth, ch);
if (desth!=ch) {
setTimeout(_resizeIframe, 500, obj, ch);
} else {
if (ch>0) obj.style.height = ch;
setTimeout(_resizeIframe, 1000, obj, ch);
if (desth == ch && ch>0) {
obj.style.height = ch + 'px';
}
setTimeout(_resizeIframe, 100, obj, ch);
}
function openClose(theID) {