From faf7a1906f17e0ebaf76008e44b226cbe590ee6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 21 Dec 2018 12:03:34 +0100 Subject: [PATCH] Replace ChildNode.before with custom before helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/js/navigation.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index db48775f0f..8fa16f5da4 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -248,8 +248,11 @@ * This method allows easy swapping of elements. */ swap: function (list, j, i) { - list[i].before(list[j]); - list[j].before(list[i]); + var before = function(node, insertNode) { + node.parentNode.insertBefore(insertNode, node); + } + before(list[i], list[j]); + before(list[j], list[i]); } };