Skip to content

Commit

Permalink
remove not working filter
Browse files Browse the repository at this point in the history
besides of that, we shouldn't need this anymore like whole getBestNode
by current text selection feature
  • Loading branch information
Simek committed Feb 19, 2015
1 parent 36699e8 commit 7160505
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions xpather.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ var tagsWithShortcuts = {
}

var attributes = ['id', 'class', 'itemprop', 'role', 'time', 'rel', 'style'];
var attributesLength = attributes.length;
var filteredTagNames = ['html', 'body', 'script'];
var attributesLength = attributes.length;
2 changes: 1 addition & 1 deletion xpather.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getNodeXPathIndex($node, tagName) {

function getBestNode(currentSelection) {
var $matchedNodes = $('body').find('*').filter(function () {
return filteredTagNames.indexOf(getNodeTagName($(this))) === -1 && $(this).text().indexOf(currentSelection) !== -1;
return $(this).text().indexOf(currentSelection) !== -1;
});

if ($matchedNodes.length === 0) {
Expand Down

0 comments on commit 7160505

Please sign in to comment.