From f484b2d64afb6dcb289bb80fcdfa414d869cd44f Mon Sep 17 00:00:00 2001 From: koalyptus Date: Wed, 17 Sep 2014 23:12:31 +0000 Subject: [PATCH] Clening up tabs --- src/tablefilter_all.js | 63 ++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/src/tablefilter_all.js b/src/tablefilter_all.js index b5f144ed..a502c433 100644 --- a/src/tablefilter_all.js +++ b/src/tablefilter_all.js @@ -56,31 +56,32 @@ var TF = (function() { if(this.tbl !== null && this.tbl.nodeName.tf_LCase() === 'table' && this.GetRowsNb() > 0){ - if(arguments.length>1) - { + if(arguments.length>1){ for(var i=0; i1) this.filtersRowIndex = this.headersRow+1; else{ this.filtersRowIndex = 1; this.headersRow = 0; } } - this.fltCellTag = f.filters_cell_tag!=undefined //defines tag of the cells containing filters (td/th) + + //defines tag of the cells containing filters (td/th) + this.fltCellTag = f.filters_cell_tag!=undefined ? (f.filters_cell_tag!='th' ? 'td' : 'th') : 'td'; + this.fltIds = []; //stores filters ids this.fltElms = []; //stores filters DOM elements this.searchArgs = null; //stores filters values @@ -133,21 +140,29 @@ var TF = (function() { this.rDiv = null; //div for reset button and results per page select this.mDiv = null; //div for paging elements this.contDiv = null; //table container div for fixed headers (IE only) - this.infDivCssClass = f.inf_div_css_class!=undefined //defines css class for div containing - ? f.inf_div_css_class : 'inf'; //paging elements, rows counter etc. - this.lDivCssClass = f.left_div_css_class!=undefined //defines css class for left div + + //defines css class for div containing paging elements, rows counter etc. + this.infDivCssClass = f.inf_div_css_class!=undefined + ? f.inf_div_css_class : 'inf'; + //defines css class for left div + this.lDivCssClass = f.left_div_css_class!=undefined ? f.left_div_css_class : 'ldiv'; - this.rDivCssClass = f.right_div_css_class!=undefined //defines css class for right div + //defines css class for right div + this.rDivCssClass = f.right_div_css_class!=undefined ? f.right_div_css_class : 'rdiv'; - this.mDivCssClass = f.middle_div_css_class!=undefined //defines css class for mid div + //defines css class for mid div + this.mDivCssClass = f.middle_div_css_class!=undefined ? f.middle_div_css_class : 'mdiv'; + //table container div css class this.contDivCssClass = f.content_div_css_class!=undefined - ? f.content_div_css_class : 'cont'; //table container div css class + ? f.content_div_css_class : 'cont'; /*** filters' grid appearance ***/ - this.stylesheet = f.stylesheet!=undefined ? f.stylesheet : this.basePath+'filtergrid.css'; //stylesheet file + //stylesheet file + this.stylesheet = f.stylesheet!=undefined ? f.stylesheet : this.basePath+'filtergrid.css'; this.stylesheetId = this.id + '_style'; - this.fltsRowCssClass = f.flts_row_css_class!=undefined //defines css class for filters row + //defines css class for filters row + this.fltsRowCssClass = f.flts_row_css_class!=undefined ? f.flts_row_css_class : 'fltrow'; this.enableIcons = f.enable_icons!=undefined ? f.enable_icons : true; //enables/disables icons (paging, reset button) this.alternateBgs = f.alternate_rows ? true : false; //enables/disbles rows alternating bg colors