mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
ColumnSelector: check visibility of cells after colspan. See #1238
This commit is contained in:
parent
aec698e22c
commit
b48e3e3e09
2
dist/js/widgets/widget-columnSelector.min.js
vendored
2
dist/js/widgets/widget-columnSelector.min.js
vendored
File diff suppressed because one or more lines are too long
@ -567,7 +567,7 @@ $.tablesorter.columnSelector.refreshColumns( config, optionName, optionState );<
|
||||
<!-- Remove column from selection popup by including -->
|
||||
<!-- data-priority="Anything other than 1-6" OR data-column-selector="disable" OR class="columnSelector-disable" -->
|
||||
<th class="columnSelector-disable">Major</th>
|
||||
<!-- columnSelector-false will initially hide the column -->
|
||||
<!-- columnSelector-false will initially hide the column; see columnSelector_mediaqueryHidden option -->
|
||||
<th class="columnSelector-false" data-priority="6" data-selector-name="Gender">Sex</th>
|
||||
<th data-priority="4">English</th>
|
||||
<th data-priority="5">Japanese</th>
|
||||
|
@ -348,7 +348,7 @@
|
||||
}
|
||||
// only add resize end if using media queries
|
||||
if ( hasSpans && wo.columnSelector_mediaquery ) {
|
||||
nspace = c.namespace.slice( 1 ) + 'columnselector';
|
||||
nspace = c.namespace + 'columnselector';
|
||||
// Setup window.resizeEnd event
|
||||
$window
|
||||
.off( nspace )
|
||||
@ -365,15 +365,18 @@
|
||||
adjustColspans: function(c, wo) {
|
||||
var index, cols, col, span, end, $cell,
|
||||
colSel = c.selector,
|
||||
autoModeOn = colSel.auto,
|
||||
$colspans = $( c.namespace + 'columnselectorHasSpan' ),
|
||||
len = $colspans.length;
|
||||
if ( len ) {
|
||||
for ( index = 0; index < len; index++ ) {
|
||||
$cell = $colspans.eq(index);
|
||||
col = parseInt( $cell.attr('data-column'), 10 ) || $cell[0].cellIndex;
|
||||
span = parseInt( $cell.attr('data-col-span'), 10 );
|
||||
end = col + span;
|
||||
filtered = wo.filter_filteredRow || 'filtered',
|
||||
autoModeOn = wo.columnSelector_mediaquery && colSel.auto,
|
||||
// find all header/footer cells in case a regular column follows a colspan; see #1238
|
||||
$headers = c.$table.children( 'thead, tfoot' ).children().children()
|
||||
.add( $(c.namespace + '_extra_table').children( 'thead, tfoot' ).children().children() ),
|
||||
len = $headers.length;
|
||||
for ( index = 0; index < len; index++ ) {
|
||||
$cell = $headers.eq(index);
|
||||
col = parseInt( $cell.attr('data-column'), 10 ) || $cell[0].cellIndex;
|
||||
span = parseInt( $cell.attr('data-col-span'), 10 ) || 1;
|
||||
end = col + span;
|
||||
if ( span > 1 ) {
|
||||
for ( cols = col; cols < end; cols++ ) {
|
||||
if ( !autoModeOn && colSel.states[ cols ] === false ||
|
||||
autoModeOn && c.$headerIndexed[ cols ] && !c.$headerIndexed[ cols ].is(':visible') ) {
|
||||
@ -381,10 +384,12 @@
|
||||
}
|
||||
}
|
||||
if ( span ) {
|
||||
$cell.removeClass( wo.filter_filteredRow || 'filtered' )[0].colSpan = span;
|
||||
$cell.removeClass( filtered )[0].colSpan = span;
|
||||
} else {
|
||||
$cell.addClass( wo.filter_filteredRow || 'filtered' );
|
||||
$cell.addClass( filtered );
|
||||
}
|
||||
} else if ( typeof colSel.states[ col ] !== 'undefined' ) {
|
||||
$cell.toggleClass( filtered, !colSel.states[ col ] );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user