hack in an appendChild listener
This commit is contained in:
parent
a8ddc09cb3
commit
cd1767ba1b
|
@ -69,7 +69,7 @@ $(function() {
|
||||||
|
|
||||||
var hijackAppendChildToExecuteAfter = function(afterFn) {
|
var hijackAppendChildToExecuteAfter = function(afterFn) {
|
||||||
const _appendChild = Node.prototype.appendChild;
|
const _appendChild = Node.prototype.appendChild;
|
||||||
const _insertBefore = Node.prototype.insertBefore;
|
const _replaceChild = Node.prototype.replaceChild;
|
||||||
|
|
||||||
Node.prototype.appendChild = function(el) {
|
Node.prototype.appendChild = function(el) {
|
||||||
_appendChild.apply(this, arguments);
|
_appendChild.apply(this, arguments);
|
||||||
|
@ -77,9 +77,9 @@ $(function() {
|
||||||
afterFn();
|
afterFn();
|
||||||
}
|
}
|
||||||
|
|
||||||
Node.prototype.insertBefore = function(el) {
|
Node.prototype.replaceChild = function(el) {
|
||||||
_insertBefore.apply(this, arguments);
|
_replaceChild.apply(this, arguments);
|
||||||
console.log('inserting before ' + el);
|
console.log('replacing ' + el);
|
||||||
afterFn();
|
afterFn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue