Don't highlight the picker, handle empty filters

This commit is contained in:
Deathamns 2015-02-10 18:59:27 +01:00
parent b3a2c9c5d3
commit fba0bf73ef
1 changed files with 8 additions and 0 deletions

View File

@ -195,6 +195,9 @@ var highlightElements = function(elems, force) {
var elem, rect, poly;
for ( var i = 0; i < elems.length; i++ ) {
elem = elems[i];
if ( elem === pickerRoot ) {
continue;
}
if ( typeof elem.getBoundingClientRect !== 'function' ) {
continue;
}
@ -386,6 +389,11 @@ var filtersFromElement = function(elem) {
var elementsFromFilter = function(filter) {
var out = [];
filter = filter.trim();
if ( filter === '' ) {
return out;
}
// Cosmetic filters: these are straight CSS selectors
// TODO: This is still not working well for a[href], because there are
// many ways to compose a valid href to the same effective URL.