From d8d77596136af39ddc591fa8b324019919e76aea Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Fri, 31 Aug 2012 18:32:01 -0300 Subject: [PATCH 1/4] Update media/src/ext/ext.paging.js Use hasChildNodes() rather than childNodes.length See the following jsperf test for the difference in performance: http://jsperf.com/haschildnodes-vs-childnodes-length --- media/src/ext/ext.paging.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/src/ext/ext.paging.js b/media/src/ext/ext.paging.js index ca001692..b1e31a55 100644 --- a/media/src/ext/ext.paging.js +++ b/media/src/ext/ext.paging.js @@ -1,4 +1,3 @@ - /* * Variable: oPagination * Purpose: @@ -223,7 +222,7 @@ $.extend( DataTable.ext.oPagination, { /* Loop over each instance of the pager */ for ( i=0, iLen=an.length ; i Date: Fri, 31 Aug 2012 18:35:00 -0300 Subject: [PATCH 2/4] Update media/src/ext/ext.paging.js Replace childNodes.length check with hasChildNodes() in one more place --- media/src/ext/ext.paging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/src/ext/ext.paging.js b/media/src/ext/ext.paging.js index b1e31a55..3540ff1e 100644 --- a/media/src/ext/ext.paging.js +++ b/media/src/ext/ext.paging.js @@ -76,7 +76,7 @@ $.extend( DataTable.ext.oPagination, { /* Loop over each instance of the pager */ for ( var i=0, iLen=an.length ; i Date: Fri, 31 Aug 2012 18:43:38 -0300 Subject: [PATCH 3/4] Update media/src/ext/ext.paging.js Use a different approach that caches nodes (may actually minify better as well) --- media/src/ext/ext.paging.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/media/src/ext/ext.paging.js b/media/src/ext/ext.paging.js index 3540ff1e..2d6ccce6 100644 --- a/media/src/ext/ext.paging.js +++ b/media/src/ext/ext.paging.js @@ -72,17 +72,22 @@ $.extend( DataTable.ext.oPagination, { var oClasses = oSettings.oClasses; var an = oSettings.aanFeatures.p; + var nNode; /* Loop over each instance of the pager */ for ( var i=0, iLen=an.length ; i Date: Fri, 31 Aug 2012 18:48:15 -0300 Subject: [PATCH 4/4] Update media/src/ext/ext.paging.js Cache node --- media/src/ext/ext.paging.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/media/src/ext/ext.paging.js b/media/src/ext/ext.paging.js index 2d6ccce6..4183646a 100644 --- a/media/src/ext/ext.paging.js +++ b/media/src/ext/ext.paging.js @@ -176,7 +176,7 @@ $.extend( DataTable.ext.oPagination, { var sList = ""; var iStartButton, iEndButton, i, iLen; var oClasses = oSettings.oClasses; - var anButtons, anStatic, nPaginateList; + var anButtons, anStatic, nPaginateList, nNode; var an = oSettings.aanFeatures.p; var fnBind = function (j) { oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) { @@ -227,18 +227,19 @@ $.extend( DataTable.ext.oPagination, { /* Loop over each instance of the pager */ for ( i=0, iLen=an.length ; i