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