1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Fix: jQuery migrate warning on display length initial setting

- jQuery migrate gives a warning about the use of `attr` rather than
  `prop`. However, we should really just be using `val` here - much
  easier.

- Thread: 13931
This commit is contained in:
Allan Jardine 2013-02-05 06:49:59 +00:00
parent 8045c7471e
commit f35801b111
2 changed files with 6 additions and 12 deletions

View File

@ -2689,12 +2689,9 @@
nLength.className = oSettings.oClasses.sLength;
nLength.innerHTML = '<label>'+oSettings.oLanguage.sLengthMenu.replace( '_MENU_', sStdMenu )+'</label>';
/*
* Set the length to the current display length - thanks to Andrea Pavlovic for this fix,
* and Stefan Skopnik for fixing the fix!
*/
$('select option[value="'+oSettings._iDisplayLength+'"]', nLength).attr("selected", true);
/* Set the length to the current display length */
$('select', nLength).val( oSettings._iDisplayLength );
$('select', nLength).bind( 'change.DT', function(e) {
var iVal = $(this).val();

View File

@ -44,12 +44,9 @@ function _fnFeatureHtmlLength ( oSettings )
nLength.className = oSettings.oClasses.sLength;
nLength.innerHTML = '<label>'+oSettings.oLanguage.sLengthMenu.replace( '_MENU_', sStdMenu )+'</label>';
/*
* Set the length to the current display length - thanks to Andrea Pavlovic for this fix,
* and Stefan Skopnik for fixing the fix!
*/
$('select option[value="'+oSettings._iDisplayLength+'"]', nLength).attr("selected", true);
/* Set the length to the current display length */
$('select', nLength).val( oSettings._iDisplayLength );
$('select', nLength).bind( 'change.DT', function(e) {
var iVal = $(this).val();