Create a spaceholder when resizing iframes.

semantics-font
Frode Petterson 2015-04-20 15:37:49 +02:00 committed by Svein-Tore Griff With
parent 165db6ff6c
commit 28f8a8dc8a
1 changed files with 6 additions and 0 deletions

View File

@ -47,6 +47,11 @@
actionHandlers.prepareResize = function (iframe, data, respond) {
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.
iframe.style.height = '1px';
@ -64,6 +69,7 @@
actionHandlers.resize = function (iframe, data, respond) {
// Resize iframe so all content is visible.
iframe.style.height = data.height + 'px';
iframe.nextSibling.remove();
};
/**