From c3a2ad6f4072010cd50ddbe08ee36deb1a4172f1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 11 Oct 2013 14:21:49 +0100 Subject: [PATCH] ize - refactor _fnInitialise for size. Only about 60 bytes saved --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 98 +++++++++++++++++------------------ 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index d430ae49..2b3c6b09 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -a0417585115ca4bb8a6675eed7738724432ad032 +3818add76a9bf921d51be2488f47e190677f4883 diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 531ad664..02b8838a 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2609,82 +2609,78 @@ /** * Draw the table for the first time, adding all required features - * @param {object} oSettings dataTables settings object + * @param {object} settings dataTables settings object * @memberof DataTable#oApi */ - function _fnInitialise ( oSettings ) + function _fnInitialise ( settings ) { - var i, iLen, iAjaxStart=oSettings.iInitDisplayStart; + var i, iLen, iAjaxStart=settings.iInitDisplayStart; + var columns = settings.aoColumn, column; + var features = settings.oFeatures; /* Ensure that the table data is fully initialised */ - if ( oSettings.bInitialised === false ) - { - setTimeout( function(){ _fnInitialise( oSettings ); }, 200 ); + if ( ! settings.bInitialised ) { + setTimeout( function(){ _fnInitialise( settings ); }, 200 ); return; } /* Show the display HTML options */ - _fnAddOptionsHtml( oSettings ); + _fnAddOptionsHtml( settings ); /* Build and draw the header / footer for the table */ - _fnBuildHead( oSettings ); - _fnDrawHead( oSettings, oSettings.aoHeader ); - _fnDrawHead( oSettings, oSettings.aoFooter ); + _fnBuildHead( settings ); + _fnDrawHead( settings, settings.aoHeader ); + _fnDrawHead( settings, settings.aoFooter ); /* Okay to show that something is going on now */ - _fnProcessingDisplay( oSettings, true ); + _fnProcessingDisplay( settings, true ); /* Calculate sizes for columns */ - if ( oSettings.oFeatures.bAutoWidth ) - { - _fnCalculateColumnWidths( oSettings ); + if ( features.bAutoWidth ) { + _fnCalculateColumnWidths( settings ); } - for ( i=0, iLen=oSettings.aoColumns.length ; i