Create a spaceholder when resizing iframes.

semantics-font
Frode Petterson 2015-04-20 15:37:49 +02:00
parent fba8badf1a
commit 59bb32fa44
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,11 @@
actionHandlers.prepareResize = function (iframe, data, respond) { actionHandlers.prepareResize = function (iframe, data, respond) {
responseData = {}; responseData = {};
// Create spaceholder and insert after iframe.
var spaceholder = document.createElement('div');
spaceholder.style.height = (iframe.clientHeight - 1) + 'px';
iframe.parentNode.insertBefore(spaceholder, iframe.nextSibling);
// Reset iframe height, in case content has shrinked. // Reset iframe height, in case content has shrinked.
iframe.style.height = '1px'; iframe.style.height = '1px';
@ -64,6 +69,7 @@
actionHandlers.resize = function (iframe, data, respond) { actionHandlers.resize = function (iframe, data, respond) {
// Resize iframe so all content is visible. // Resize iframe so all content is visible.
iframe.style.height = data.height + 'px'; iframe.style.height = data.height + 'px';
iframe.nextSibling.remove();
}; };
/** /**