From 8433f654af1ff9fee495d492d66e6de98f9d7e75 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); }; /**