Added dom method, made tbl property private

This commit is contained in:
Max Guglielmi 2017-04-14 19:30:58 +10:00
parent b9ab9582a8
commit 76a61d5a01
45 changed files with 171 additions and 148 deletions

4
dist/starter.html vendored
View File

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>tablefilter v0.5.6 - Starter</title>
<title>tablefilter v0.5.7 - Starter</title>
</head>
<body>
<h1>tablefilter v0.5.6</h1>
<h1>tablefilter v0.5.7</h1>

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
span.colVisSpan{text-align:left;}span.colVisSpan a.colVis{display:inline-block;padding:7px 5px 0;font-size:inherit;font-weight:inherit;vertical-align:top}div.colVisCont{position:relative;background:#fff;-webkit-box-shadow:3px 3px 2px #888;-moz-box-shadow:3px 3px 2px #888;box-shadow:3px 3px 2px #888;position:absolute;display:none;border:1px solid #ccc;height:auto;width:250px;background-color:#fff;margin:35px 0 0 -100px;z-index:10000;padding:10px 10px 10px 10px;text-align:left;font-size:12px;}div.colVisCont:after,div.colVisCont:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.colVisCont:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:10px;margin-left:-10px}div.colVisCont:before{border-color:rgba(255,255,255,0);border-bottom-color:#ccc;border-width:12px;margin-left:-12px}div.colVisCont p{margin:6px auto 6px auto}div.colVisCont a.colVis{display:initial;font-weight:inherit}ul.cols_checklist{padding:0;margin:0;list-style:none;}ul.cols_checklist label{display:block}ul.cols_checklist input{vertical-align:middle;margin:2px 5px 2px 1px}li.cols_checklist_item{padding:4px;margin:0;}li.cols_checklist_item:hover{background-color:#335ea8;color:#fff}.cols_checklist_slc_item{background-color:#335ea8;color:#fff}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
span.expClpFlt a.btnExpClpFlt{width:35px;height:35px;display:inline-block;}span.expClpFlt a.btnExpClpFlt:hover{background-color:#f4f4f4}span.expClpFlt img{padding:8px 11px 11px 11px}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
.activeHeader{background-color:#66afe9 !important;color:#fff !important}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
table.TF{padding:0;color:#000;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-left:1px solid #a4bed4;border-bottom:0;}table.TF th{margin:0;color:inherit;background:#d1e5fe url("images/bg_skyblue.gif") 0 0 repeat-x;border-color:#fdfdfd #a4bed4 #a4bed4 #fdfdfd;border-width:1px;border-style:solid}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid #a4bed4;border-left:0;border-top:0;border-right:0}.fltrow{background-color:#d1e5fe !important;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4 !important}input.flt{width:99% !important}.inf{background-color:#e3efff !important;border:1px solid #a4bed4;height:$min-height;color:#004a6f}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#ffe4ab url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#ffe4ab url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#ffe4ab url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#ffe4ab url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.activeHeader{background:#ffe4ab !important;border:1px solid #ffb552 !important;color:inherit !important}div.grd_Cont{background-color:#d9eaed !important;border:1px solid #9cc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#e3efff}div.grd_headTblCont{background-color:#d9eaed !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#d9eaed url("images/bg_skyblue.gif") left top repeat-x;border-bottom:1px solid #a4bed4;border-right:1px solid #a4bed4 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #a4bed4 !important;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:#cce2fe;color:#004a6f;border-top:1px solid #9cc !important;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#2d8eef;border:1px solid #cce2fe;border-radius:5px}.even{background-color:#fff}.odd{background-color:#e3efff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ffdc61 !important;color:inherit}.ezSelectedRow{background-color:#ffe4ab !important;color:inherit}.ezActiveCell{background-color:#fff !important;color:#000 !important;font-weight:bold}.ezETSelectedCell{background-color:#fff !important;font-weight:bold;color:#000 !important}

View File

@ -1,6 +1,6 @@
/**
* tablefilter v0.5.6 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z
* tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-14T09:23:17.399Z
* MIT License
*/
table.TF{padding:0;color:inherit;border-right:1px solid transparent;border-top:1px solid transparent;border-left:1px solid transparent;border-bottom:0;}table.TF th{margin:0;color:inherit;background-color:transparent;border-color:transparent;border-width:1px;border-style:solid;}table.TF th:last-child{border-right:1px solid transparent}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid transparent;border-left:0;border-top:0;border-right:0}.fltrow{background-color:transparent;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px;border-bottom:1px solid transparent !important;}.fltrow th:last-child,.fltrow td:last-child{border-right:1px solid transparent}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4}input.flt{width:99% !important}.inf{background-color:transparent;border:1px solid transparent;height:$min-height;color:inherit}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#f7f7f7 url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#f7f7f7 url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#f7f7f7 url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#f7f7f7 url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.activeHeader{background:#f7f7f7 !important;border:1px solid transparent;color:inherit !important}div.grd_Cont{-webkit-box-shadow:0 0 0 0 rgba(50,50,50,0.75);-moz-box-shadow:0 0 0 0 rgba(50,50,50,0.75);box-shadow:0 0 0 0 rgba(50,50,50,0.75);background-color:transparent;border:1px solid transparent;padding:0 !important;}div.grd_Cont .even{background-color:transparent}div.grd_Cont .odd{background-color:#f7f7f7}div.grd_headTblCont{background-color:transparent;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:transparent;border-bottom:1px solid transparent;border-right:1px solid transparent !important;border-left:1px solid transparent;border-top:1px solid transparent}div.grd_tblCont table td{border-bottom:1px solid transparent;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:transparent;color:inherit;border-top:1px solid transparent;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#f7f7f7;border:1px solid #f7f7f7;border-radius:5px;color:#000;text-shadow:none}.even{background-color:transparent}.odd{background-color:#f7f7f7}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ccc !important;color:inherit}.ezSelectedRow{background-color:#ccc !important;color:inherit}.ezActiveCell{background-color:transparent;color:inherit;font-weight:bold}.ezETSelectedCell{background-color:transparent;font-weight:bold;color:inherit}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "tablefilter",
"version": "0.5.6",
"version": "0.5.7",
"description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT",
"author": {

View File

@ -117,7 +117,7 @@ export default class AdapterEzEditTable extends Feature {
//start row for EditTable constructor needs to be calculated
let startRow,
cfg = this.cfg,
thead = tag(tf.tbl, 'thead');
thead = tag(tf.dom(), 'thead');
//if thead exists and startRow not specified, startRow is calculated
//automatically by EditTable
@ -158,7 +158,7 @@ export default class AdapterEzEditTable extends Feature {
et.ClearSelections();
/* eslint-enable */
let cellIndex = selectedElm.cellIndex,
row = tf.tbl.rows[nextRowIndex];
row = tf.dom().rows[nextRowIndex];
if (et.defaultSelection === 'both') {
/* eslint-disable */
slc.SelectRowByIndex(nextRowIndex);
@ -172,7 +172,7 @@ export default class AdapterEzEditTable extends Feature {
}
//Table is filtered
if (tf.validRowsIndex.length !== tf.getRowsNb()) {
let r = tf.tbl.rows[nextRowIndex];
let r = tf.dom().rows[nextRowIndex];
if (r) {
r.scrollIntoView(false);
}

View File

@ -164,7 +164,7 @@ export default class ColOps extends Feature {
});
let nbCols = uIndexes.length,
rows = tf.tbl.rows,
rows = tf.dom().rows,
colValues = [];
for (let u = 0; u < nbCols; u++) {

View File

@ -459,7 +459,7 @@ export default class ColsVisibility extends Feature {
let ul = createElm('ul');
ul.className = this.listCssClass;
let tbl = this.headersTbl ? this.headersTbl : tf.tbl;
let tbl = this.headersTbl ? this.headersTbl : tf.dom();
let headerIndex = this.headersTbl ?
this.headersIndex : tf.getHeadersRowIndex();
let headerRow = tbl.rows[headerIndex];
@ -535,7 +535,7 @@ export default class ColsVisibility extends Feature {
*/
setHidden(colIndex, hide) {
let tf = this.tf;
let tbl = tf.tbl;
let tbl = tf.dom();
if (hide) {
this.onBeforeColHidden(this, colIndex);
@ -598,7 +598,7 @@ export default class ColsVisibility extends Feature {
let width = parseInt(gridColElms[colIndex].style.width, 10);
headTbl.style.width =
(parseInt(headTbl.style.width, 10) + width) + 'px';
tf.tbl.style.width = headTbl.style.width;
tf.dom().style.width = headTbl.style.width;
}
this.onAfterColDisplayed(this, colIndex);

View File

@ -244,7 +244,7 @@ export default class FiltersVisibility extends Feature {
*/
toggle() {
let tf = this.tf;
let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.tbl;
let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.dom();
let fltRow = tbl.rows[this.filtersRowIndex];
let isDisplayed = fltRow.style.display === '';
@ -258,7 +258,7 @@ export default class FiltersVisibility extends Feature {
*/
show(visible = true) {
let tf = this.tf;
let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.tbl;
let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.dom();
let fltRow = tbl.rows[this.filtersRowIndex];
if (visible) {

View File

@ -430,7 +430,7 @@ export default class AdapterSortableTable extends Feature {
this.addSortType(STRING);
this.addSortType(IP_ADDRESS, ipAddress, sortIP);
this.stt = new SortableTable(tf.tbl, _sortTypes);
this.stt = new SortableTable(tf.dom(), _sortTypes);
/*** external table headers adapter ***/
if (this.asyncSort && this.triggerIds.length > 0) {

View File

@ -94,7 +94,7 @@ export class AlternateRows extends Feature {
if (!this.isEnabled() || isNaN(rowIdx)) {
return;
}
let rows = this.tf.tbl.rows;
let rows = this.tf.dom().rows;
let i = isNaN(idx) ? rowIdx : idx;
this.removeRowBg(rowIdx);
@ -110,7 +110,7 @@ export class AlternateRows extends Feature {
if (isNaN(idx)) {
return;
}
let rows = this.tf.tbl.rows;
let rows = this.tf.dom().rows;
removeClass(rows[idx], this.oddCss);
removeClass(rows[idx], this.evenCss);
}

View File

@ -227,7 +227,7 @@ export class CheckList extends Feature {
['colIndex', colIndex]);
ul.className = this.filterCssClass;
let rows = tf.tbl.rows;
let rows = tf.dom().rows;
let nbRows = tf.getRowsNb(true);
let caseSensitive = tf.caseSensitive;
this.isCustom = tf.isCustomOptions(colIndex);

View File

@ -182,7 +182,7 @@ export class Dropdown extends Feature {
let slcId = tf.fltIds[colIndex];
let slc = elm(slcId);
let rows = tf.tbl.rows;
let rows = tf.dom().rows;
let nbRows = tf.getRowsNb(true);
//custom select test

View File

@ -112,14 +112,14 @@ export class GridLayout extends Feature {
* @type {String}
* @private
*/
this.sourceTblHtml = tf.tbl.outerHTML;
this.sourceTblHtml = tf.dom().outerHTML;
/**
* Indicates if working table has column elements
* @type {Boolean}
* @private
*/
this.tblHasColTag = tag(tf.tbl, 'col').length > 0 ? true : false;
this.tblHasColTag = tag(tf.dom(), 'col').length > 0 ? true : false;
/**
* Main container element
@ -155,7 +155,7 @@ export class GridLayout extends Feature {
*/
init() {
let tf = this.tf;
let tbl = tf.tbl;
let tbl = tf.dom();
if (this.initialized) {
return;
@ -319,7 +319,7 @@ export class GridLayout extends Feature {
}
for (let k = 0, len = tf.getCellsNb(); k < len; k++) {
let colW;
let cell = tf.tbl.rows[tf.getHeadersRowIndex()].cells[k];
let cell = tf.dom().rows[tf.getHeadersRowIndex()].cells[k];
if (cell.width !== '') {
colW = cell.width;
} else if (cell.style.width !== '') {
@ -339,7 +339,7 @@ export class GridLayout extends Feature {
* @private
*/
initialTableWidth() {
let tbl = this.tf.tbl;
let tbl = this.tf.dom();
let width; //initial table width
if (tbl.width !== '') {
@ -392,7 +392,7 @@ export class GridLayout extends Feature {
*/
setColumnElements() {
let tf = this.tf;
let cols = tag(tf.tbl, 'col');
let cols = tag(tf.dom(), 'col');
this.tblHasColTag = cols.length > 0;
for (let k = (tf.nbCells - 1); k >= 0; k--) {
@ -400,7 +400,7 @@ export class GridLayout extends Feature {
if (!this.tblHasColTag) {
col = createElm('col');
tf.tbl.insertBefore(col, tf.tbl.firstChild);
tf.dom().insertBefore(col, tf.dom().firstChild);
} else {
col = cols[k];
}
@ -423,7 +423,7 @@ export class GridLayout extends Feature {
} else {
// Headers row are moved from content table to headers table
for (let i = 0; i < this.headRows.length; i++) {
let row = this.tf.tbl.rows[this.headRows[i]];
let row = this.tf.dom().rows[this.headRows[i]];
tableHead.appendChild(row);
}
}
@ -471,7 +471,7 @@ export class GridLayout extends Feature {
*/
destroy() {
let tf = this.tf;
let tbl = tf.tbl;
let tbl = tf.dom();
if (!this.initialized) {
return;

View File

@ -99,7 +99,7 @@ export class HighlightKeyword {
* @param {String} cssClass Css class to remove
*/
unhighlight(term, cssClass) {
let highlightedNodes = this.tf.tbl.querySelectorAll(`.${cssClass}`);
let highlightedNodes = this.tf.dom().querySelectorAll(`.${cssClass}`);
for (let i = 0; i < highlightedNodes.length; i++) {
let n = highlightedNodes[i];
let nodeVal = getText(n);

View File

@ -100,9 +100,9 @@ export class Loader extends Feature {
containerDiv.className = this.cssClass;
let targetEl = !this.targetId ?
tf.tbl.parentNode : elm(this.targetId);
tf.dom().parentNode : elm(this.targetId);
if (!this.targetId) {
targetEl.insertBefore(containerDiv, tf.tbl);
targetEl.insertBefore(containerDiv, tf.dom());
} else {
targetEl.appendChild(containerDiv);
}
@ -119,9 +119,7 @@ export class Loader extends Feature {
emitter.on(EVENTS, () => this.show(''));
emitter.on(EVENTS, () => this.show(NONE));
/**
* @inherited
*/
/** @inherited */
this.initialized = true;
}

View File

@ -97,7 +97,7 @@ export class NoResults extends Feature {
}
let tf = this.tf;
let target = this.customContainer || elm(this.customContainerId) ||
tf.tbl;
tf.dom();
//container
let cont = createElm('div');
@ -176,8 +176,9 @@ export class NoResults extends Feature {
let gridLayout = tf.feature('gridLayout');
this.cont.style.width = gridLayout.tblCont.clientWidth + 'px';
} else {
this.cont.style.width = (tf.tbl.tHead ? tf.tbl.tHead.clientWidth :
tf.tbl.tBodies[0].clientWidth) + 'px';
this.cont.style.width = (tf.dom().tHead ?
tf.dom().tHead.clientWidth :
tf.dom().tBodies[0].clientWidth) + 'px';
}
}

View File

@ -556,7 +556,7 @@ export class Paging extends Feature {
*/
groupByPage(validRows) {
var tf = this.tf;
var rows = tf.tbl.rows;
var rows = tf.dom().rows;
var startPagingRow = parseInt(this.startPagingRow, 10);
var endPagingRow = startPagingRow + parseInt(this.pagingLength, 10);

View File

@ -76,6 +76,7 @@ export class TableFilter {
/**
* HTML Table DOM element
* @type {DOMElement}
* @private
*/
this.tbl = null;
@ -997,6 +998,9 @@ export class TableFilter {
* @private
*/
this.ExtRegistry = {};
//load styles if necessary
this.import(this.stylesheetId, this.stylesheet, null, 'link');
}
/**
@ -1012,13 +1016,8 @@ export class TableFilter {
let n = this.singleSearchFlt ? 1 : this.nbCells;
let inpclass;
//loads stylesheet if not imported
this.import(this.stylesheetId, this.stylesheet, null, 'link');
//loads theme
if (this.hasThemes) {
this.loadThemes();
}
this.loadThemes();
// Instanciate sugar date wrapper
Mod.dateType = Mod.dateType || new DateType(this);
@ -1156,16 +1155,14 @@ export class TableFilter {
//TF css class is added to table
if (!this.gridLayout) {
addClass(this.tbl, this.prfxTf);
addClass(this.dom(), this.prfxTf);
if (this.responsive) {
addClass(this.tbl, this.prfxResponsive);
addClass(this.dom(), this.prfxResponsive);
}
}
/* Loads extensions */
if (this.hasExtensions) {
this.initExtensions();
}
/* Load extensions */
this.initExtensions();
// Subscribe to events
if (this.markActiveColumns) {
@ -1282,11 +1279,11 @@ export class TableFilter {
}
let fltrow;
let thead = tag(this.tbl, 'thead');
let thead = tag(this.dom(), 'thead');
if (thead.length > 0) {
fltrow = thead[0].insertRow(this.filtersRowIndex);
} else {
fltrow = this.tbl.insertRow(this.filtersRowIndex);
fltrow = this.dom().insertRow(this.filtersRowIndex);
}
fltrow.className = this.fltsRowCssClass;
@ -1386,6 +1383,10 @@ export class TableFilter {
* Initialise all the extensions defined in the configuration object
*/
initExtensions() {
if (!this.hasExtensions) {
return;
}
let exts = this.extensions;
// Set config's publicPath dynamically for Webpack...
__webpack_public_path__ = this.basePath;
@ -1464,6 +1465,10 @@ export class TableFilter {
* Load themes defined in the configuration object
*/
loadThemes() {
if (!this.hasThemes) {
return;
}
let themes = this.themes;
this.emitter.emit('before-loading-themes', this);
@ -1534,7 +1539,7 @@ export class TableFilter {
this.validateAllRows();
if (this.fltGrid && !this.gridLayout) {
this.tbl.deleteRow(this.filtersRowIndex);
this.dom().deleteRow(this.filtersRowIndex);
}
// broadcast destroy event modules and extensions are subscribed to
@ -1550,8 +1555,8 @@ export class TableFilter {
this.emitter.off(['filter-focus'],
(tf, filter) => this.setActiveFilterId(filter.id));
removeClass(this.tbl, this.prfxTf);
removeClass(this.tbl, this.prfxResponsive);
removeClass(this.dom(), this.prfxTf);
removeClass(this.dom(), this.prfxResponsive);
this.nbHiddenRows = 0;
this.validRowsIndex = [];
@ -1585,7 +1590,7 @@ export class TableFilter {
else {
let cont = createElm('caption');
cont.appendChild(infDiv);
this.tbl.insertBefore(cont, this.tbl.firstChild);
this.dom().insertBefore(cont, this.dom().firstChild);
}
this.infDiv = infDiv;
@ -1627,7 +1632,7 @@ export class TableFilter {
removeElm(this.infDiv);
this.infDiv = null;
let tbl = this.tbl;
let tbl = this.dom();
let captions = tag(tbl, 'caption');
if (captions.length > 0) {
[].forEach.call(captions, (elm) => tbl.removeChild(elm));
@ -1709,7 +1714,7 @@ export class TableFilter {
this.onBeforeFilter(this);
this.emitter.emit('before-filtering', this);
let row = this.tbl.rows,
let row = this.dom().rows,
nbRows = this.getRowsNb(true),
hiddenRows = 0;
@ -2102,7 +2107,7 @@ export class TableFilter {
typed = false,
exclude = []
) {
let row = this.tbl.rows;
let row = this.dom().rows;
let nbRows = this.getRowsNb(true);
let colValues = [];
let getContent = typed ? this.getCellData.bind(this) :
@ -2245,7 +2250,7 @@ export class TableFilter {
* @return {Number} Number of cells
*/
getCellsNb(rowIndex = 0) {
let tr = this.tbl.rows[rowIndex >= 0 ? rowIndex : 0];
let tr = this.dom().rows[rowIndex >= 0 ? rowIndex : 0];
return tr ? tr.cells.length : 0;
}
@ -2257,7 +2262,7 @@ export class TableFilter {
*/
getRowsNb(includeHeaders) {
let s = isUndef(this.refRow) ? 0 : this.refRow;
let ntrs = this.tbl.rows.length;
let ntrs = this.dom().rows.length;
if (includeHeaders) {
s = 0;
}
@ -2358,7 +2363,7 @@ export class TableFilter {
excludeHiddenCols = false,
typed = false
) {
let rows = this.tbl.rows;
let rows = this.dom().rows;
let nbRows = this.getRowsNb(true);
let tblData = [];
let getContent = typed ? this.getCellData.bind(this) :
@ -2440,7 +2445,7 @@ export class TableFilter {
if (this.validRowsIndex.length === 0) {
return [];
}
let rows = this.tbl.rows,
let rows = this.dom().rows,
filteredData = [];
let getContent = typed ? this.getCellData.bind(this) :
this.getCellValue.bind(this);
@ -2548,7 +2553,7 @@ export class TableFilter {
return [];
}
let rows = this.tbl.rows;
let rows = this.dom().rows;
let getContent = typed ? this.getCellData.bind(this) :
this.getCellValue.bind(this);
@ -2588,7 +2593,7 @@ export class TableFilter {
* @param {Boolean} isValid
*/
validateRow(rowIndex, isValid) {
let row = this.tbl.rows[rowIndex];
let row = this.dom().rows[rowIndex];
if (!row || typeof isValid !== 'boolean') {
return;
}
@ -2687,7 +2692,7 @@ export class TableFilter {
if (!this.hasColWidths) {
return;
}
tbl = tbl || this.tbl;
tbl = tbl || this.dom();
let nbCols = this.nbCells;
let colWidths = this.colWidths;
@ -2896,7 +2901,7 @@ export class TableFilter {
* @returns {Boolean}
*/
isRowDisplayed(rowIndex) {
let row = this.tbl.rows[rowIndex];
let row = this.dom().rows[rowIndex];
return this.getRowDisplay(row) === '';
}
@ -3023,7 +3028,7 @@ export class TableFilter {
let nbRows = this.getRowsNb(true);
this.validRowsIndex = [];
for (let k = this.refRow; k < nbRows; k++) {
let r = this.tbl.rows[k];
let r = this.dom().rows[k];
if (!this.paging) {
if (this.getRowDisplay(r) !== NONE) {
this.validRowsIndex.push(r.rowIndex);
@ -3095,7 +3100,7 @@ export class TableFilter {
* @return {Element}
*/
getHeaderElement(colIndex) {
let table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.tbl;
let table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.dom();
let tHead = tag(table, 'thead');
let headersRow = this.headersRow;
let header;
@ -3161,6 +3166,14 @@ export class TableFilter {
return this.getValidRows(reCalc).length;
}
/**
* Return the working DOM element
* @return {HTMLTableElement}
*/
dom() {
return this.tbl;
}
/**
* Get the configuration object (literal object)
* @return {Object}

View File

@ -4,7 +4,7 @@ var tf = new TableFilter('demo', {
alternate_rows: true
});
tf.init();
var tbl = tf.tbl;
var tbl = tf.dom();
var altRows = tf.feature('alternateRows');
module('Sanity checks');
@ -288,7 +288,7 @@ test('Grid layout: initialising alternating rows', function() {
alternate_rows: true
});
tf.init();
tbl = tf.tbl;
tbl = tf.dom();
altRows = tf.feature('alternateRows');
deepEqual(
@ -352,7 +352,7 @@ test('Sort: alternating rows with column sorted at start', function() {
deepEqual(altRows.oddCss, 'odd', 'Expected odd css class');
function checkAlternateRows(tf) {
tbl = tf.tbl;
tbl = tf.dom();
altRows = tf.feature('alternateRows');
test('Alternate rows with sort column at start option', function() {

View File

@ -15,8 +15,8 @@
test('for filtered table', function() {
tf.setFilterValue(0, 'Hello');
tf.filter();
var alwaysVisibleRow1 = tf.tbl.rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9];
var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual(
tf.getRowDisplay(alwaysVisibleRow1),
'',
@ -31,8 +31,8 @@
test('after filters are cleared', function() {
tf.clearFilters();
var alwaysVisibleRow1 = tf.tbl.rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9];
var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual(
tf.getRowDisplay(alwaysVisibleRow1),
'',
@ -62,8 +62,8 @@
test('for filtered table', function() {
tf.setFilterValue(0, 'Hello');
tf.filter();
var alwaysVisibleRow1 = tf.tbl.rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9];
var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual(
tf.getRowDisplay(alwaysVisibleRow1),
'',
@ -78,8 +78,8 @@
test('after filters are cleared', function() {
tf.clearFilters();
var alwaysVisibleRow1 = tf.tbl.rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9];
var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual(
tf.getRowDisplay(alwaysVisibleRow1),
'none',
@ -95,8 +95,8 @@
test('after changing pagination page', function() {
paging.setPage(2);
var alwaysVisibleRow1 = tf.tbl.rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9];
var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual(
tf.getRowDisplay(alwaysVisibleRow1),
'',

View File

@ -28,6 +28,7 @@ test('TableFilter object', function() {
deepEqual(tf.getFilterId(0), 'flt0_demo', 'Filter DOM element id');
deepEqual(tf.getStartRowIndex(), 2, 'Start of filterable rows');
deepEqual(tf.getLastRowIndex(), 8, 'Last row index');
deepEqual(tf.dom().nodeName, 'TABLE', 'Working DOM element type');
deepEqual(
tf.getHeadersText(),
[
@ -42,7 +43,7 @@ test('TableFilter object', function() {
);
deepEqual(tf.getValidRowsNb(), 0, 'Number of valid rows before filtering');
deepEqual(
tf.getCellData(tf.tbl.rows[3].cells[2]),
tf.getCellData(tf.dom().rows[3].cells[2]),
982,
'getCellData returns typed value'
);

View File

@ -41,7 +41,7 @@
test('Can parse with custom function', function() {
// setup
var cell = tf.tbl.rows[3].cells[0];
var cell = tf.dom().rows[3].cells[0];
// act
var value = tf.getCellValue(cell);
@ -55,7 +55,7 @@
// setup
var initialCellParser = tf.cellParser;
var hit = 0;
var cell = tf.tbl.rows[3].cells[0];
var cell = tf.dom().rows[3].cells[0];
tf.cellParser.cols = [];
tf.cellParser.parse = function() {

View File

@ -9,7 +9,7 @@
module('Sanity checks');
test('Column widths', function() {
var cols = tf.tbl.getElementsByTagName('col');
var cols = tf.dom().getElementsByTagName('col');
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
deepEqual(cols[1].style.width, '100px', 'Expected column width');
deepEqual(cols[4].style.width, '', 'Expected column width');

View File

@ -70,7 +70,7 @@ test('Popup container auto-closes when user clicks away', function() {
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj);
tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert
deepEqual(ext.contEl.style.display, 'none',

View File

@ -69,7 +69,7 @@ test('Popup container auto-closes when user clicks away', function() {
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj);
tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert
deepEqual(ext.contEl.style.display, 'none',

View File

@ -5,7 +5,7 @@ var tf = new TableFilter('demo', {
});
tf.init();
var rowsCounter = tf.feature('rowsCounter');
var rowToAdd = tf.tbl.rows[8];
var rowToAdd = tf.dom().rows[8];
var tf1 = new TableFilter('demo', {
base_path: '../dist/tablefilter/',
@ -27,7 +27,7 @@ module('DOM changes');
test('Can filter after row is removed', function() {
// setup
tf.clearFilters();
tf.tbl.deleteRow(-1);
tf.dom().deleteRow(-1);
// act
tf.filter();
@ -44,7 +44,7 @@ test('Can filter after row is removed', function() {
test('Can filter after row is added', function() {
// setup
tf.clearFilters();
tf.tbl.tBodies[0].appendChild(rowToAdd);
tf.dom().tBodies[0].appendChild(rowToAdd);
// act
tf.filter();
@ -104,7 +104,7 @@ test('Can filter and change a page after row is removed', function() {
var paging = tf1.feature('paging');
var rowsCounter = tf1.feature('rowsCounter');
tf1.clearFilters();
tf1.tbl.deleteRow(-1);
tf1.dom().deleteRow(-1);
// act
tf1.filter();
@ -124,7 +124,7 @@ test('Can filter and change page after row is added', function() {
var paging = tf1.feature('paging');
var rowsCounter = tf1.feature('rowsCounter');
tf1.clearFilters();
tf1.tbl.tBodies[0].appendChild(rowToAdd);
tf1.dom().tBodies[0].appendChild(rowToAdd);
// act
tf1.filter();

View File

@ -236,9 +236,9 @@ test('can filter date with different date format', function(){
test('can filter empty value with [empty] operator', function(){
// setup
var cellValue = tf.getCellValue(tf.tbl.rows[2].cells[2]);
var cellValue = tf.getCellValue(tf.dom().rows[2].cells[2]);
tf.clearFilters();
tf.tbl.rows[2].cells[2].innerHTML = '';
tf.dom().rows[2].cells[2].innerHTML = '';
// act
tf.setFilterValue(2, '[empty]');
@ -251,7 +251,7 @@ test('can filter empty value with [empty] operator', function(){
'Expected match'
);
tf.tbl.rows[2].cells[2].innerHTML = cellValue;
tf.dom().rows[2].cells[2].innerHTML = cellValue;
});
test('can filter empty value with [nonempty] operator', function(){

View File

@ -11,7 +11,7 @@ tf.init();
var extTargetElement = document.createElement('div');
extTargetElement.setAttribute('id', 'test');
document.body.insertBefore(extTargetElement, tf.tbl);
document.body.insertBefore(extTargetElement, tf.dom());
module('Sanity checks');
test('Filters visibility extension', function() {

View File

@ -7,7 +7,7 @@ tf.init();
var extTargetElement = document.createElement('div');
extTargetElement.setAttribute('id', 'test');
document.body.insertBefore(extTargetElement, tf.tbl);
document.body.insertBefore(extTargetElement, tf.dom());
module('Sanity checks');
test('Filters visibility extension', function() {
@ -33,7 +33,7 @@ module('Check behaviours');
test('Toggle filters', function() {
var ext = tf.extension('filtersVisibility');
ext.toggle();
var filtersRow = tf.tbl.rows[tf.getFiltersRowIndex()];
var filtersRow = tf.dom().rows[tf.getFiltersRowIndex()];
deepEqual(filtersRow.style.display, 'none', 'Filters hidden');
ext.toggle();
deepEqual(filtersRow.style.display, '', 'Filters displayed');

View File

@ -70,7 +70,7 @@ test('Help container auto-closes when user clicks away', function() {
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj);
tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert
deepEqual(help.cont.style.display, 'none',

View File

@ -17,12 +17,12 @@ test('Highlighted keywords', function() {
tf.setFilterValue(1, 'Perth');
tf.setFilterValue(3, '3.1');
tf.filter();
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 2,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 2,
'Number of applied CSS classes');
tf.clearFilters();
// issue 155
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 0,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 0,
'Number of applied CSS classes');
});
@ -30,17 +30,17 @@ test('Highlighted keywords', function() {
test('Match same term with increasing number of chars', function() {
tf.setFilterValue(1, 'Pe');
tf.filter();
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 1,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 1,
'Search term matched');
tf.setFilterValue(1, 'Per');
tf.filter();
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 1,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 1,
'Search term matched');
tf.setFilterValue(1, 'Pert');
tf.filter();
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 1,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 1,
'Search term matched');
});
@ -59,7 +59,7 @@ test('can destroy TableFilter DOM elements and clean highlighted words',
tf.filter();
tf.destroy();
deepEqual(tf.isInitialized(), false, 'Filters removed');
deepEqual(tf.tbl.querySelectorAll('.keyword').length, 0,
deepEqual(tf.dom().querySelectorAll('.keyword').length, 0,
'Number of applied CSS classes');
}
);

View File

@ -12,6 +12,22 @@ test('Loader component', function() {
notEqual(loader, null, 'Loader instanciated');
equal(loader.cont.nodeName, 'DIV', 'Loader DOM container');
});
test('Does not init if initialised', function() {
// setup
var show = loader.show;
var hit = 0;
loader.show = function() {
hit++;
}
// act
loader.init();
// assert
deepEqual(hit, 0, 'does not initialise');
loader.show = show;
});
module('Feature interface');
test('Properties', function() {

View File

@ -156,7 +156,7 @@ test('Pop-up filter auto-closes when user clicks away', function() {
// act
var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true);
tf.tbl.rows[4].cells[2].dispatchEvent(evObj);
tf.dom().rows[4].cells[2].dispatchEvent(evObj);
// assert
deepEqual(popupFilter.isOpen(0), false,

View File

@ -47,7 +47,7 @@ function startTest(tf, sort){
deepEqual(indicator.length, 1, 'Sort indicator in header element');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
(tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'AUY78',
'First custom key cell text before sorting');
});
@ -58,7 +58,7 @@ function startTest(tf, sort){
deepEqual(sort.sorted, true, 'Table column sorted');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
(tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'QT1',
'First custom key cell text after sorting');
});

View File

@ -39,7 +39,7 @@ function start(tf, sort){
deepEqual(indicator.length, 1, 'Sort indicator in header element');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
(tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'AUY78',
'First custom key cell text before sorting');
});
@ -50,7 +50,7 @@ function start(tf, sort){
deepEqual(sort.sorted, true, 'Table column sorted');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
(tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'QT1',
'First custom key cell text after sorting');
});

View File

@ -15,10 +15,14 @@
module('Table 1: DOM tests');
test('Filters row', function() {
equal(tf.tbl.rows[0].className, 'fltrow', 'Filters row CSS class name');
equal(
tf.dom().rows[0].className,
'fltrow',
'Filters row CSS class name'
);
equal(tf.getFilterElement(0).nodeName, 'INPUT', 'Filter DOM element');
deepEqual(
tf.tbl.scrollWidth === tf.tbl.clientWidth,
tf.dom().scrollWidth === tf.dom().clientWidth,
true,
'Horizontal scrollbar is not displayed'
);
@ -40,7 +44,7 @@
module('Table 2: sanity checks');
test('TableFilter instance', function() {
notEqual(tf1.id, null, 'id check');
deepEqual(tf1.tbl.classList.contains(tf1.prfxResponsive), true,
deepEqual(tf1.dom().classList.contains(tf1.prfxResponsive), true,
'Responsive CSS class');
equal(tf1.filtersRowIndex, 1, 'Filters row index');
deepEqual(tf1.getCellsNb(), 5, 'filters type collection length');
@ -49,13 +53,13 @@
module('Table 2: DOM tests');
test('Filters row', function() {
equal(
tf1.tbl.rows[1].className,
tf1.dom().rows[1].className,
'fltrow',
'Filters row CSS class name'
);
equal(tf1.getFilterElement(0).nodeName, 'INPUT', 'Filter DOM element');
deepEqual(
tf1.tbl.scrollWidth > tf1.tbl.clientWidth,
tf1.dom().scrollWidth > tf1.dom().clientWidth,
true,
'Horizontal scrollbar is displayed'
);