1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-09 17:32:31 +02:00

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> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>tablefilter v0.5.6 - Starter</title> <title>tablefilter v0.5.7 - Starter</title>
</head> </head>
<body> <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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * MIT License
*/ */
.activeHeader{background-color:#66afe9 !important;color:#fff !important} .activeHeader{background-color:#66afe9 !important;color:#fff !important}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.5.6 by Max Guglielmi * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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 * tablefilter v0.5.7 by Max Guglielmi
* build date: 2017-04-10T16:27:15.240Z * build date: 2017-04-14T09:23:17.399Z
* MIT License * 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} 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", "name": "tablefilter",
"version": "0.5.6", "version": "0.5.7",
"description": "A Javascript library making HTML tables filterable and a bit more", "description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT", "license": "MIT",
"author": { "author": {

View file

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

View file

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

View file

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

View file

@ -244,7 +244,7 @@ export default class FiltersVisibility extends Feature {
*/ */
toggle() { toggle() {
let tf = this.tf; 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 fltRow = tbl.rows[this.filtersRowIndex];
let isDisplayed = fltRow.style.display === ''; let isDisplayed = fltRow.style.display === '';
@ -258,7 +258,7 @@ export default class FiltersVisibility extends Feature {
*/ */
show(visible = true) { show(visible = true) {
let tf = this.tf; 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 fltRow = tbl.rows[this.filtersRowIndex];
if (visible) { if (visible) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -99,7 +99,7 @@ export class HighlightKeyword {
* @param {String} cssClass Css class to remove * @param {String} cssClass Css class to remove
*/ */
unhighlight(term, cssClass) { 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++) { for (let i = 0; i < highlightedNodes.length; i++) {
let n = highlightedNodes[i]; let n = highlightedNodes[i];
let nodeVal = getText(n); let nodeVal = getText(n);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -15,8 +15,8 @@
test('for filtered table', function() { test('for filtered table', function() {
tf.setFilterValue(0, 'Hello'); tf.setFilterValue(0, 'Hello');
tf.filter(); tf.filter();
var alwaysVisibleRow1 = tf.tbl.rows[4]; var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9]; var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual( deepEqual(
tf.getRowDisplay(alwaysVisibleRow1), tf.getRowDisplay(alwaysVisibleRow1),
'', '',
@ -31,8 +31,8 @@
test('after filters are cleared', function() { test('after filters are cleared', function() {
tf.clearFilters(); tf.clearFilters();
var alwaysVisibleRow1 = tf.tbl.rows[4]; var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9]; var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual( deepEqual(
tf.getRowDisplay(alwaysVisibleRow1), tf.getRowDisplay(alwaysVisibleRow1),
'', '',
@ -62,8 +62,8 @@
test('for filtered table', function() { test('for filtered table', function() {
tf.setFilterValue(0, 'Hello'); tf.setFilterValue(0, 'Hello');
tf.filter(); tf.filter();
var alwaysVisibleRow1 = tf.tbl.rows[4]; var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9]; var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual( deepEqual(
tf.getRowDisplay(alwaysVisibleRow1), tf.getRowDisplay(alwaysVisibleRow1),
'', '',
@ -78,8 +78,8 @@
test('after filters are cleared', function() { test('after filters are cleared', function() {
tf.clearFilters(); tf.clearFilters();
var alwaysVisibleRow1 = tf.tbl.rows[4]; var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9]; var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual( deepEqual(
tf.getRowDisplay(alwaysVisibleRow1), tf.getRowDisplay(alwaysVisibleRow1),
'none', 'none',
@ -95,8 +95,8 @@
test('after changing pagination page', function() { test('after changing pagination page', function() {
paging.setPage(2); paging.setPage(2);
var alwaysVisibleRow1 = tf.tbl.rows[4]; var alwaysVisibleRow1 = tf.dom().rows[4];
var alwaysVisibleRow2 = tf.tbl.rows[9]; var alwaysVisibleRow2 = tf.dom().rows[9];
deepEqual( deepEqual(
tf.getRowDisplay(alwaysVisibleRow1), 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.getFilterId(0), 'flt0_demo', 'Filter DOM element id');
deepEqual(tf.getStartRowIndex(), 2, 'Start of filterable rows'); deepEqual(tf.getStartRowIndex(), 2, 'Start of filterable rows');
deepEqual(tf.getLastRowIndex(), 8, 'Last row index'); deepEqual(tf.getLastRowIndex(), 8, 'Last row index');
deepEqual(tf.dom().nodeName, 'TABLE', 'Working DOM element type');
deepEqual( deepEqual(
tf.getHeadersText(), tf.getHeadersText(),
[ [
@ -42,7 +43,7 @@ test('TableFilter object', function() {
); );
deepEqual(tf.getValidRowsNb(), 0, 'Number of valid rows before filtering'); deepEqual(tf.getValidRowsNb(), 0, 'Number of valid rows before filtering');
deepEqual( deepEqual(
tf.getCellData(tf.tbl.rows[3].cells[2]), tf.getCellData(tf.dom().rows[3].cells[2]),
982, 982,
'getCellData returns typed value' 'getCellData returns typed value'
); );

View file

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

View file

@ -9,7 +9,7 @@
module('Sanity checks'); module('Sanity checks');
test('Column widths', function() { test('Column widths', function() {
var cols = tf.tbl.getElementsByTagName('col'); var cols = tf.dom().getElementsByTagName('col');
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
deepEqual(cols[1].style.width, '100px', 'Expected column width'); deepEqual(cols[1].style.width, '100px', 'Expected column width');
deepEqual(cols[4].style.width, '', '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'); var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true); evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell // mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj); tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert // assert
deepEqual(ext.contEl.style.display, 'none', 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'); var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true); evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell // mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj); tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert // assert
deepEqual(ext.contEl.style.display, 'none', deepEqual(ext.contEl.style.display, 'none',

View file

@ -5,7 +5,7 @@ var tf = new TableFilter('demo', {
}); });
tf.init(); tf.init();
var rowsCounter = tf.feature('rowsCounter'); var rowsCounter = tf.feature('rowsCounter');
var rowToAdd = tf.tbl.rows[8]; var rowToAdd = tf.dom().rows[8];
var tf1 = new TableFilter('demo', { var tf1 = new TableFilter('demo', {
base_path: '../dist/tablefilter/', base_path: '../dist/tablefilter/',
@ -27,7 +27,7 @@ module('DOM changes');
test('Can filter after row is removed', function() { test('Can filter after row is removed', function() {
// setup // setup
tf.clearFilters(); tf.clearFilters();
tf.tbl.deleteRow(-1); tf.dom().deleteRow(-1);
// act // act
tf.filter(); tf.filter();
@ -44,7 +44,7 @@ test('Can filter after row is removed', function() {
test('Can filter after row is added', function() { test('Can filter after row is added', function() {
// setup // setup
tf.clearFilters(); tf.clearFilters();
tf.tbl.tBodies[0].appendChild(rowToAdd); tf.dom().tBodies[0].appendChild(rowToAdd);
// act // act
tf.filter(); tf.filter();
@ -104,7 +104,7 @@ test('Can filter and change a page after row is removed', function() {
var paging = tf1.feature('paging'); var paging = tf1.feature('paging');
var rowsCounter = tf1.feature('rowsCounter'); var rowsCounter = tf1.feature('rowsCounter');
tf1.clearFilters(); tf1.clearFilters();
tf1.tbl.deleteRow(-1); tf1.dom().deleteRow(-1);
// act // act
tf1.filter(); tf1.filter();
@ -124,7 +124,7 @@ test('Can filter and change page after row is added', function() {
var paging = tf1.feature('paging'); var paging = tf1.feature('paging');
var rowsCounter = tf1.feature('rowsCounter'); var rowsCounter = tf1.feature('rowsCounter');
tf1.clearFilters(); tf1.clearFilters();
tf1.tbl.tBodies[0].appendChild(rowToAdd); tf1.dom().tBodies[0].appendChild(rowToAdd);
// act // act
tf1.filter(); 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(){ test('can filter empty value with [empty] operator', function(){
// setup // setup
var cellValue = tf.getCellValue(tf.tbl.rows[2].cells[2]); var cellValue = tf.getCellValue(tf.dom().rows[2].cells[2]);
tf.clearFilters(); tf.clearFilters();
tf.tbl.rows[2].cells[2].innerHTML = ''; tf.dom().rows[2].cells[2].innerHTML = '';
// act // act
tf.setFilterValue(2, '[empty]'); tf.setFilterValue(2, '[empty]');
@ -251,7 +251,7 @@ test('can filter empty value with [empty] operator', function(){
'Expected match' '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(){ test('can filter empty value with [nonempty] operator', function(){

View file

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

View file

@ -7,7 +7,7 @@ tf.init();
var extTargetElement = document.createElement('div'); var extTargetElement = document.createElement('div');
extTargetElement.setAttribute('id', 'test'); extTargetElement.setAttribute('id', 'test');
document.body.insertBefore(extTargetElement, tf.tbl); document.body.insertBefore(extTargetElement, tf.dom());
module('Sanity checks'); module('Sanity checks');
test('Filters visibility extension', function() { test('Filters visibility extension', function() {
@ -33,7 +33,7 @@ module('Check behaviours');
test('Toggle filters', function() { test('Toggle filters', function() {
var ext = tf.extension('filtersVisibility'); var ext = tf.extension('filtersVisibility');
ext.toggle(); ext.toggle();
var filtersRow = tf.tbl.rows[tf.getFiltersRowIndex()]; var filtersRow = tf.dom().rows[tf.getFiltersRowIndex()];
deepEqual(filtersRow.style.display, 'none', 'Filters hidden'); deepEqual(filtersRow.style.display, 'none', 'Filters hidden');
ext.toggle(); ext.toggle();
deepEqual(filtersRow.style.display, '', 'Filters displayed'); 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'); var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true); evObj.initEvent('mouseup', true, true);
// mouseup fired from a table cell // mouseup fired from a table cell
tf.tbl.rows[3].cells[2].dispatchEvent(evObj); tf.dom().rows[3].cells[2].dispatchEvent(evObj);
// assert // assert
deepEqual(help.cont.style.display, 'none', deepEqual(help.cont.style.display, 'none',

View file

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

View file

@ -12,6 +12,22 @@ test('Loader component', function() {
notEqual(loader, null, 'Loader instanciated'); notEqual(loader, null, 'Loader instanciated');
equal(loader.cont.nodeName, 'DIV', 'Loader DOM container'); 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'); module('Feature interface');
test('Properties', function() { test('Properties', function() {

View file

@ -156,7 +156,7 @@ test('Pop-up filter auto-closes when user clicks away', function() {
// act // act
var evObj = document.createEvent('HTMLEvents'); var evObj = document.createEvent('HTMLEvents');
evObj.initEvent('mouseup', true, true); evObj.initEvent('mouseup', true, true);
tf.tbl.rows[4].cells[2].dispatchEvent(evObj); tf.dom().rows[4].cells[2].dispatchEvent(evObj);
// assert // assert
deepEqual(popupFilter.isOpen(0), false, 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(indicator.length, 1, 'Sort indicator in header element');
deepEqual( deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML, (tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'AUY78', 'AUY78',
'First custom key cell text before sorting'); 'First custom key cell text before sorting');
}); });
@ -58,7 +58,7 @@ function startTest(tf, sort){
deepEqual(sort.sorted, true, 'Table column sorted'); deepEqual(sort.sorted, true, 'Table column sorted');
deepEqual( deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML, (tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'QT1', 'QT1',
'First custom key cell text after sorting'); '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(indicator.length, 1, 'Sort indicator in header element');
deepEqual( deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML, (tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'AUY78', 'AUY78',
'First custom key cell text before sorting'); 'First custom key cell text before sorting');
}); });
@ -50,7 +50,7 @@ function start(tf, sort){
deepEqual(sort.sorted, true, 'Table column sorted'); deepEqual(sort.sorted, true, 'Table column sorted');
deepEqual( deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML, (tf.dom().rows[validRows[0]].cells[1]).innerHTML,
'QT1', 'QT1',
'First custom key cell text after sorting'); 'First custom key cell text after sorting');
}); });

View file

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