forked from EdddieN/machinon-domoticz_theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom.js
30 lines (21 loc) · 786 Bytes
/
custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$( document ).ready(function() {
// Create an observer instance linked to the callback function
var observer = new MutationObserver(function(mutationsList, observer) {
$(mutationsList).each(function(index, item){
if (item.type === 'childList'){
if (item.addedNodes.length > 0){
console.log('new div is being added! ' + item.name );
}
if (item.removedNodes.length > 0){
console.log('div has been removed ' + item.name );
}
}
});
});
// Start observing the target node for configured mutations
observer.observe( document, {
attributes: true,
childList: true,
subtree: true
});
});