Skip to content

Commit

Permalink
Better checking for search input support. Thank you modernizr
Browse files Browse the repository at this point in the history
  • Loading branch information
mjangda committed Nov 11, 2010
1 parent 905d441 commit 8d1ccf5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jquery.listFilterizer.js
Expand Up @@ -58,7 +58,7 @@
}

// IE freaks out if you try to set the input type as search
var inputType = ('placeholder' in document.createElement('input')) ? 'search' : 'text';
var inputType = searchSupported() ? 'search' : 'text';

$input = $('<input/>')
.attr('type', inputType)
Expand Down Expand Up @@ -152,6 +152,12 @@
// Do the init thing!
init(this);
});

function searchSupported() {
var inputElem = document.createElement('input');
inputElem.setAttribute('type', 'search');
return inputElem.type !== 'text';
}
}

$.fn.listFilterizer.defaults = {
Expand Down

0 comments on commit 8d1ccf5

Please sign in to comment.