Permalink
Browse files

replace input[text] with HTML5 input[search]

  • Loading branch information...
1 parent 3e1a41d commit 4577a52056127d2fc64efd0b22a9416b415ed7e3 David Steinkopff committed Feb 28, 2013
Showing with 13 additions and 13 deletions.
  1. +13 −13 media/js/jquery.dataTables.js
@@ -2134,40 +2134,40 @@
function _fnFeatureHtmlFilter ( oSettings )
{
var oPreviousSearch = oSettings.oPreviousSearch;
-
+
var sSearchStr = oSettings.oLanguage.sSearch;
sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
- sSearchStr.replace('_INPUT_', '<input type="text" />') :
- sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';
-
+ sSearchStr.replace('_INPUT_', '<input type="search" />') :
+ sSearchStr==="" ? '<input type="search" />' : sSearchStr+' <input type="search" />';
+
var nFilter = document.createElement( 'div' );
nFilter.className = oSettings.oClasses.sFilter;
nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
if ( !oSettings.aanFeatures.f )
{
nFilter.id = oSettings.sTableId+'_filter';
}
-
- var jqFilter = $('input[type="text"]', nFilter);
-
+
+ var jqFilter = $('input[type="search"]', nFilter);
+
// Store a reference to the input element, so other input elements could be
// added to the filter wrapper if needed (submit button for example)
nFilter._DT_Input = jqFilter[0];
-
+
jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
- jqFilter.bind( 'keyup.DT', function(e) {
+ jqFilter.bind( 'keyup.DT search', function(e) {
/* Update all other filter input elements for the new display */
var n = oSettings.aanFeatures.f;
var val = this.value==="" ? "" : this.value; // mental IE8 fix :-(
-
+
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
{
$(n[i]._DT_Input).val( val );
}
}
-
+
/* Now do the filter */
if ( val != oPreviousSearch.sSearch )
{
@@ -2179,7 +2179,7 @@
} );
}
} );
-
+
jqFilter
.attr('aria-controls', oSettings.sTableId)
.bind( 'keypress.DT', function(e) {
@@ -2190,7 +2190,7 @@
}
}
);
-
+
return nFilter;
}

0 comments on commit 4577a52

Please sign in to comment.