From cd1767ba1bc385d575e4715721ddb2fa19fab49b Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Mon, 13 Apr 2020 17:19:02 +0200 Subject: [PATCH] hack in an appendChild listener --- static/js/codex.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/codex.js b/static/js/codex.js index cc5cef5..4b0c188 100644 --- a/static/js/codex.js +++ b/static/js/codex.js @@ -69,7 +69,7 @@ $(function() { var hijackAppendChildToExecuteAfter = function(afterFn) { const _appendChild = Node.prototype.appendChild; - const _insertBefore = Node.prototype.insertBefore; + const _replaceChild = Node.prototype.replaceChild; Node.prototype.appendChild = function(el) { _appendChild.apply(this, arguments); @@ -77,9 +77,9 @@ $(function() { afterFn(); } - Node.prototype.insertBefore = function(el) { - _insertBefore.apply(this, arguments); - console.log('inserting before ' + el); + Node.prototype.replaceChild = function(el) { + _replaceChild.apply(this, arguments); + console.log('replacing ' + el); afterFn(); } }