diff --git a/examples/basic_init/zero_config.html b/examples/basic_init/zero_config.html index 26f84812d..e7eda3208 100644 --- a/examples/basic_init/zero_config.html +++ b/examples/basic_init/zero_config.html @@ -28,7 +28,7 @@

Preamble

Live example

- +
diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 66b297bbe..b3341e2f7 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -5135,6 +5135,10 @@ var nWrapper = oSettings.nTable.parentNode; nWrapper.appendChild( nCalcTmp ); + /* When scrolling (X or Y) we want to set the width of the table as appropriate. However, + * when not scrolling leave the table width as it is. This results in slightly different, + * but I think correct behaviour + */ if ( oSettings.oScroll.sX !== "" && oSettings.oScroll.sXInner !== "" ) { nCalcTmp.style.width = _fnStringToCss(oSettings.oScroll.sXInner); @@ -5147,7 +5151,7 @@ nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth ); } } - else + else if ( oSettings.oScroll.sY !== "" ) { nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth ); } diff --git a/media/unit_testing/tests_onhold/1_dom/2530-2.js b/media/unit_testing/tests_onhold/1_dom/2530-2.js new file mode 100755 index 000000000..cba8cf813 --- /dev/null +++ b/media/unit_testing/tests_onhold/1_dom/2530-2.js @@ -0,0 +1,15 @@ +// DATA_TEMPLATE: dom_data +oTest.fnStart( "User given with is left when no scrolling" ); + +$(document).ready( function () { + $('#example')[0].style.width = "80%"; + $('#example').dataTable(); + + oTest.fnTest( + "Check user width is left", + null, + function () { return $('#example').width() == 640; } + ); + + oTest.fnComplete(); +} ); \ No newline at end of file
Rendering engine