This commit is contained in:
Jiiks 2015-10-29 16:52:39 +02:00
parent 69d85fe54a
commit 0bd797d89e
1 changed files with 1 additions and 6 deletions

View File

@ -200,27 +200,22 @@ EmoteModule.prototype.obsCallback = function(mutation) {
}; };
EmoteModule.prototype.getNodes = function(node) { EmoteModule.prototype.getNodes = function(node) {
console.log("GETNODES=>");
var next; var next;
var nodes = []; var nodes = [];
var treeWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT, null, false); var treeWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT, null, false);
while(next = treeWalker.nextNode()) { while(next = treeWalker.nextNode()) {
console.log("NEXT: " + next);
nodes.push(next); nodes.push(next);
} }
if(nodes.length < 1) { if(nodes.length < 1) {
treeWalker = document.createTreeWalker(node.parentElement, NodeFilter.SHOW_TEXT); treeWalker = document.createTreeWalker(node.parentElement, NodeFilter.SHOW_TEXT);
while(next = treeWalker.nextNode()) { while(next = treeWalker.nextNode()) {
console.log("PACCEPTED: " + next);
console.log(next);
nodes.push(next); nodes.push(next);
} }
} }
console.log("<=GETNODES");
return nodes; return nodes;
}; };