Skip to content

Commit

Permalink
fix(ie10): fix IE10 problems with treeWalker
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Feb 12, 2016
1 parent 49d7322 commit 9fad7c1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/util/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,8 @@ class Util {
if (!node) {
return false;
}
const args = [node, type];
if (filter) {
args.push(filter);
}
const args = [node, type, filter || (() => true), false];
args.push(false);
const walker = document.createTreeWalker(...args);
while (walker.nextNode()) {
if (!func(walker.currentNode)) {
Expand All @@ -427,9 +425,7 @@ class Util {
* @param {Object} [filter] skips empty text nodes by default
* @returns {boolean} true if function did abort walk
*/
static walkTextNodes(el, func, filter = {
acceptNode: (node) => !Util.nodeIsEmpty(node)
}) {
static walkTextNodes(el, func, filter = (node) => !Util.nodeIsEmpty(node)) {
return Util.walkDom(el, func, NodeFilter.SHOW_TEXT, filter);
}

Expand Down

0 comments on commit 9fad7c1

Please sign in to comment.