From b3dea65fd8cd548760e578b58fa796f68ca9c03f Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 21 Apr 2015 13:56:24 +0200 Subject: [PATCH] Remove element from DOM the correct way. --- js/h5p-resizer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/h5p-resizer.js b/js/h5p-resizer.js index 3d83db6..894951b 100644 --- a/js/h5p-resizer.js +++ b/js/h5p-resizer.js @@ -46,7 +46,7 @@ */ 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'; @@ -69,7 +69,7 @@ actionHandlers.resize = function (iframe, data, respond) { // Resize iframe so all content is visible. iframe.style.height = data.height + 'px'; - iframe.nextSibling.remove(); + iframe.parentNode.removeChild(iframe.nextSibling); }; /**