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]); } };