1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

Fix: Length menu language with wrapper element wasn't correctly populated

* Due to the manipulation of DOM elements rather than strings for the
  length list, the browser was cropping elements which were being cut
  short. Fix is to switch back to string manipulation, which can be done
  easily using the outerHTML property of the DOM element. This is
  supported in all browsers since Firefox 11, so happy to use it here.
* See thread 21170 for more information
This commit is contained in:
Allan Jardine 2014-05-20 08:36:53 +01:00
parent 36e1e86297
commit d6b54b4cde
2 changed files with 5 additions and 6 deletions

View File

@ -1 +1 @@
97ab8a3d4bb981c4643ebcabf0809f71ca4524ea
6e60b4ee7b7683c94165c56e5b6a961100d60501

View File

@ -3210,13 +3210,12 @@
div[0].id = tableId+'_length';
}
var a = settings.oLanguage.sLengthMenu.split(/(_MENU_)/);
div.children().append( a.length > 1 ?
$(a[0]).add(select).add(a[2]) :
a[0]
div.children().append(
settings.oLanguage.sLengthMenu.replace( '_MENU_', select[0].outerHTML )
);
// Can't use `select` variable, as user might provide their own select menu
// Can't use `select` variable as user might provide their own and the
// reference is broken by the use of outerHTML
$('select', div)
.val( settings._iDisplayLength )
.bind( 'change.DT', function(e) {