mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-16 12:45:49 +02:00
Removed isIE helper
This commit is contained in:
parent
ad6812391b
commit
3cf37e3c0f
|
@ -13012,7 +13012,7 @@
|
||||||
'number', 'number', 'number',
|
'number', 'number', 'number',
|
||||||
'number', 'number', 'number'
|
'number', 'number', 'number'
|
||||||
]
|
]
|
||||||
}]
|
},{ name: 'colsVisibility' }]
|
||||||
};
|
};
|
||||||
|
|
||||||
var tf = new TableFilter('demo', filtersConfig);
|
var tf = new TableFilter('demo', filtersConfig);
|
||||||
|
|
|
@ -105,6 +105,7 @@
|
||||||
auto_filter_delay: 200,
|
auto_filter_delay: 200,
|
||||||
loader: true,
|
loader: true,
|
||||||
// themes: [{ name: 'skyblue'}],
|
// themes: [{ name: 'skyblue'}],
|
||||||
|
popup_filters: true,
|
||||||
paging: true,
|
paging: true,
|
||||||
paging_length: 3,
|
paging_length: 3,
|
||||||
alternate_rows: true,
|
alternate_rows: true,
|
||||||
|
|
11
dist/tablefilter/tablefilter.js
vendored
11
dist/tablefilter/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
7
dist/tablefilter/tf-1.js
vendored
7
dist/tablefilter/tf-1.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,6 @@
|
||||||
import Dom from '../../dom';
|
import Dom from '../../dom';
|
||||||
import Types from '../../types';
|
import Types from '../../types';
|
||||||
import Event from '../../event';
|
import Event from '../../event';
|
||||||
import Helpers from '../../helpers';
|
|
||||||
import Arr from '../../array';
|
import Arr from '../../array';
|
||||||
|
|
||||||
export default class ColsVisibility{
|
export default class ColsVisibility{
|
||||||
|
@ -113,8 +112,8 @@ export default class ColsVisibility{
|
||||||
if(tf.gridLayout){
|
if(tf.gridLayout){
|
||||||
this.headersTbl = tf.feature('gridLayout').headTbl; //headers table
|
this.headersTbl = tf.feature('gridLayout').headTbl; //headers table
|
||||||
this.headersIndex = 0; //headers index
|
this.headersIndex = 0; //headers index
|
||||||
// this.onAfterColDisplayed = function(){};
|
this.onAfterColDisplayed = function(){};
|
||||||
// this.onAfterColHidden = function(){};
|
this.onAfterColHidden = function(){};
|
||||||
}
|
}
|
||||||
|
|
||||||
//Loads extension stylesheet
|
//Loads extension stylesheet
|
||||||
|
@ -370,44 +369,33 @@ export default class ColsVisibility{
|
||||||
var gridColElms;
|
var gridColElms;
|
||||||
if(this.onAfterColHidden && hide){
|
if(this.onAfterColHidden && hide){
|
||||||
//This event is fired just after a column is displayed for
|
//This event is fired just after a column is displayed for
|
||||||
//grid_layout compatibility
|
//grid_layout support
|
||||||
|
//TODO: grid layout module should be responsible for those
|
||||||
|
//calculations
|
||||||
if(tf.gridLayout){
|
if(tf.gridLayout){
|
||||||
gridLayout = tf.feature('gridLayout');
|
gridLayout = tf.feature('gridLayout');
|
||||||
headTbl = gridLayout.headTbl;
|
headTbl = gridLayout.headTbl;
|
||||||
gridColElms = gridLayout.gridColElms;
|
gridColElms = gridLayout.gridColElms;
|
||||||
if(Helpers.isIE()){
|
var hiddenWidth = parseInt(
|
||||||
tbl.style.width = headTbl.clientWidth + 'px';
|
gridColElms[colIndex].style.width, 10);
|
||||||
} else {
|
|
||||||
var ths = headTbl.rows[this.headersIndex].cells;
|
|
||||||
var hiddenWidth = 0;
|
|
||||||
for(var i=0; i<tf.nbCells; i++){
|
|
||||||
if(ths[i].style.display === 'none'){
|
|
||||||
var w = parseInt(ths[i].style.width, 10);
|
|
||||||
ths[i].style.width = 0;
|
|
||||||
hiddenWidth += w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var headTblW = parseInt(headTbl.style.width, 10);
|
|
||||||
|
|
||||||
|
var headTblW = parseInt(headTbl.style.width, 10);
|
||||||
headTbl.style.width = headTblW - hiddenWidth + 'px';
|
headTbl.style.width = headTblW - hiddenWidth + 'px';
|
||||||
tbl.style.width = headTbl.style.width;
|
tbl.style.width = headTbl.style.width;
|
||||||
gridColElms[colIndex].style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.onAfterColHidden.call(null, this, colIndex);
|
this.onAfterColHidden.call(null, this, colIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.onAfterColDisplayed && !hide){
|
if(this.onAfterColDisplayed && !hide){
|
||||||
//This event is fired just after a column is displayed for
|
//This event is fired just after a column is displayed for
|
||||||
//grid_layout compatibility
|
//grid_layout support
|
||||||
|
//TODO: grid layout module should be responsible for those
|
||||||
|
//calculations
|
||||||
if(tf.gridLayout){
|
if(tf.gridLayout){
|
||||||
gridLayout = tf.feature('gridLayout');
|
gridLayout = tf.feature('gridLayout');
|
||||||
headTbl = gridLayout.headTbl;
|
headTbl = gridLayout.headTbl;
|
||||||
gridColElms = gridLayout.gridColElms;
|
gridColElms = gridLayout.gridColElms;
|
||||||
gridColElms[colIndex].style.display = '';
|
|
||||||
var width = parseInt(gridColElms[colIndex].style.width, 10);
|
var width = parseInt(gridColElms[colIndex].style.width, 10);
|
||||||
var header = tf.getHeaderElement(colIndex);
|
|
||||||
header.style.width = width +'px';
|
|
||||||
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.tbl.style.width = headTbl.style.width;
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
import Str from './string';
|
import Str from './string';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
isIE(){
|
|
||||||
return (/msie|MSIE/).test(navigator.userAgent);
|
|
||||||
},
|
|
||||||
|
|
||||||
removeNbFormat(data, format){
|
removeNbFormat(data, format){
|
||||||
if(!data){
|
if(!data){
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -125,12 +125,6 @@ export class Help{
|
||||||
var divDisplay = this.cont.style.display;
|
var divDisplay = this.cont.style.display;
|
||||||
if(divDisplay === '' || divDisplay === 'none'){
|
if(divDisplay === '' || divDisplay === 'none'){
|
||||||
this.cont.style.display = 'inline';
|
this.cont.style.display = 'inline';
|
||||||
// TODO: use CSS instead for element positioning
|
|
||||||
// var btnLeft = Dom.position(this.btn).left;
|
|
||||||
// if(!this.contTgtId){
|
|
||||||
// this.cont.style.left =
|
|
||||||
// (btnLeft - this.cont.clientWidth + 25) + 'px';
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
this.cont.style.display = 'none';
|
this.cont.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import Types from '../types';
|
import Types from '../types';
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import Event from '../event';
|
import Event from '../event';
|
||||||
import Helpers from '../helpers';
|
|
||||||
|
|
||||||
export class PopupFilter{
|
export class PopupFilter{
|
||||||
|
|
||||||
|
@ -69,10 +68,6 @@ export class PopupFilter{
|
||||||
var popUpDiv = this.popUpFltElms[colIndex],
|
var popUpDiv = this.popUpFltElms[colIndex],
|
||||||
header = this.tf.getHeaderElement(colIndex),
|
header = this.tf.getHeaderElement(colIndex),
|
||||||
headerWidth = header.clientWidth * 0.95;
|
headerWidth = header.clientWidth * 0.95;
|
||||||
if(Helpers.isIE()){
|
|
||||||
var headerLeft = Dom.position(header).left;
|
|
||||||
popUpDiv.style.left = (headerLeft) + 'px';
|
|
||||||
}
|
|
||||||
popUpDiv.style.width = parseInt(headerWidth, 10) + 'px';
|
popUpDiv.style.width = parseInt(headerWidth, 10) + 'px';
|
||||||
}
|
}
|
||||||
Event.cancel(evt);
|
Event.cancel(evt);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import Types from '../types';
|
import Types from '../types';
|
||||||
import Helpers from '../helpers';
|
|
||||||
|
|
||||||
export class RowsCounter{
|
export class RowsCounter{
|
||||||
|
|
||||||
|
@ -62,10 +61,6 @@ export class RowsCounter{
|
||||||
var targetEl = !this.rowsCounterTgtId ?
|
var targetEl = !this.rowsCounterTgtId ?
|
||||||
tf.lDiv : Dom.id( this.rowsCounterTgtId );
|
tf.lDiv : Dom.id( this.rowsCounterTgtId );
|
||||||
|
|
||||||
//IE only: clears all for sure
|
|
||||||
if(this.rowsCounterDiv && Helpers.isIE()){
|
|
||||||
this.rowsCounterDiv.outerHTML = '';
|
|
||||||
}
|
|
||||||
//default container: 'lDiv'
|
//default container: 'lDiv'
|
||||||
if(!this.rowsCounterTgtId){
|
if(!this.rowsCounterTgtId){
|
||||||
countDiv.appendChild(countText);
|
countDiv.appendChild(countText);
|
||||||
|
@ -125,20 +120,12 @@ export class RowsCounter{
|
||||||
|
|
||||||
destroy(){
|
destroy(){
|
||||||
var tf = this.tf;
|
var tf = this.tf;
|
||||||
if(!tf.hasGrid()){
|
if(!tf.hasGrid() || !this.rowsCounterSpan){
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!this.rowsCounterSpan){
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.rowsCounterTgtId && this.rowsCounterDiv){
|
if(!this.rowsCounterTgtId && this.rowsCounterDiv){
|
||||||
//IE only: clears all for sure
|
|
||||||
if(Helpers.isIE()){
|
|
||||||
this.rowsCounterDiv.outerHTML = '';
|
|
||||||
} else {
|
|
||||||
this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv);
|
this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Dom.id(this.rowsCounterTgtId).innerHTML = '';
|
Dom.id(this.rowsCounterTgtId).innerHTML = '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import Types from '../types';
|
import Types from '../types';
|
||||||
// import Helpers from '../helpers';
|
|
||||||
|
|
||||||
var global = window;
|
var global = window;
|
||||||
|
|
||||||
|
@ -70,11 +69,6 @@ export class StatusBar{
|
||||||
var targetEl = (!this.statusBarTgtId) ?
|
var targetEl = (!this.statusBarTgtId) ?
|
||||||
tf.lDiv : Dom.id(this.statusBarTgtId);
|
tf.lDiv : Dom.id(this.statusBarTgtId);
|
||||||
|
|
||||||
// TODO: use alternative to outerHTML
|
|
||||||
// if(this.statusBarDiv && Helpers.isIE()){
|
|
||||||
// this.statusBarDiv.outerHTML = '';
|
|
||||||
// }
|
|
||||||
|
|
||||||
//default container: 'lDiv'
|
//default container: 'lDiv'
|
||||||
if(!this.statusBarTgtId){
|
if(!this.statusBarTgtId){
|
||||||
statusDiv.appendChild(statusSpanText);
|
statusDiv.appendChild(statusSpanText);
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
'number', 'number', 'number',
|
'number', 'number', 'number',
|
||||||
'number', 'number', 'number'
|
'number', 'number', 'number'
|
||||||
]
|
]
|
||||||
}]
|
},{ name: 'colsVisibility' }]
|
||||||
};
|
};
|
||||||
|
|
||||||
var tf = new TableFilter('demo', filtersConfig);
|
var tf = new TableFilter('demo', filtersConfig);
|
||||||
|
|
|
@ -72,18 +72,4 @@ module.exports = {
|
||||||
new StringReplacePlugin()
|
new StringReplacePlugin()
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// ,
|
|
||||||
// plugins: [
|
|
||||||
// // new webpack.DefinePlugin({
|
|
||||||
// // 'process.env': {
|
|
||||||
// // // This has effect on the react lib size
|
|
||||||
// // 'NODE_ENV': JSON.stringify('production')
|
|
||||||
// // }
|
|
||||||
// // }),
|
|
||||||
// // new webpack.IgnorePlugin(/adapterSortabletable$/),
|
|
||||||
// new Clean(['dist']),
|
|
||||||
// new webpack.optimize.DedupePlugin(),
|
|
||||||
// new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 10000 }),
|
|
||||||
// new webpack.optimize.UglifyJsPlugin()
|
|
||||||
// ]
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue