Replace ChildNode.before with custom before helper

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-12-21 12:03:34 +01:00 committed by Backportbot
parent 01fa79d8d6
commit faf7a1906f

View file

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