mirror of
https://github.com/friendica/friendica
synced 2025-04-23 10:30:11 +00:00
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:
parent
9f17b925c6
commit
76b1b109e5
3 changed files with 30 additions and 25 deletions
13
js/main.js
13
js/main.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue