|
4 | 4 | ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5 | 5 | █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6 | 6 | */
|
7 |
| -/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/ |
| 7 | +/*! tablesorter (FORK) - updated 09-27-2017 (v2.29.0)*/ |
8 | 8 | /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9 | 9 | (function(factory) {
|
10 | 10 | if (typeof define === 'function' && define.amd) {
|
|
16 | 16 | }
|
17 | 17 | }(function(jQuery) {
|
18 | 18 |
|
19 |
| -/*! TableSorter (FORK) v2.28.15 *//* |
| 19 | +/*! TableSorter (FORK) v2.29.0 *//* |
20 | 20 | * Client-side table sorting with ease!
|
21 | 21 | * @requires jQuery v1.2.6+
|
22 | 22 | *
|
|
40 | 40 | 'use strict';
|
41 | 41 | var ts = $.tablesorter = {
|
42 | 42 |
|
43 |
| - version : '2.28.15', |
| 43 | + version : '2.29.0', |
44 | 44 |
|
45 | 45 | parsers : [],
|
46 | 46 | widgets : [],
|
|
439 | 439 | e.stopPropagation();
|
440 | 440 | ts.applyWidgetId( this, id );
|
441 | 441 | })
|
442 |
| - .bind( 'applyWidgets' + namespace, function( e, init ) { |
| 442 | + .bind( 'applyWidgets' + namespace, function( e, callback ) { |
443 | 443 | e.stopPropagation();
|
444 |
| - // apply widgets |
445 |
| - ts.applyWidget( this, init ); |
| 444 | + // apply widgets (false = not initializing) |
| 445 | + ts.applyWidget( this, false, callback ); |
446 | 446 | })
|
447 | 447 | .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
|
448 | 448 | e.stopPropagation();
|
|
479 | 479 | downTarget = null;
|
480 | 480 | if ( core !== true ) {
|
481 | 481 | $headers.addClass( namespace.slice( 1 ) + '_extra_headers' );
|
482 |
| - tmp = $.fn.closest ? $headers.closest( 'table' )[ 0 ] : $headers.parents( 'table' )[ 0 ]; |
483 |
| - if ( tmp && tmp.nodeName === 'TABLE' && tmp !== table ) { |
484 |
| - $( tmp ).addClass( namespace.slice( 1 ) + '_extra_table' ); |
| 482 | + tmp = ts.getClosest( $headers, 'table' ); |
| 483 | + if ( tmp.length && tmp[ 0 ].nodeName === 'TABLE' && tmp[ 0 ] !== table ) { |
| 484 | + $( tmp[ 0 ] ).addClass( namespace.slice( 1 ) + '_extra_table' ); |
485 | 485 | }
|
486 | 486 | }
|
487 | 487 | tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' )
|
|
533 | 533 | ts.buildCache( c );
|
534 | 534 | }
|
535 | 535 | // jQuery v1.2.6 doesn't have closest()
|
536 |
| - $cell = $.fn.closest ? $( this ).closest( 'th, td' ) : |
537 |
| - /TH|TD/.test( this.nodeName ) ? $( this ) : $( this ).parents( 'th, td' ); |
| 536 | + $cell = ts.getHeaderCell( $( this ) ); |
538 | 537 | // reference original table headers and find the same cell
|
539 | 538 | // don't use $headers or IE8 throws an error - see #987
|
540 | 539 | temp = $headers.index( $cell );
|
|
574 | 573 | '';
|
575 | 574 | // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683
|
576 | 575 | c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) {
|
577 |
| - var configHeaders, header, column, template, tmp, |
| 576 | + var configHeaders, header, column, template, tmp, $th, |
578 | 577 | $elem = $( elem );
|
579 | 578 | // ignore cell (don't add it to c.$headers) if row has ignoreRow class
|
580 | 579 | if ( $elem.parent().hasClass( c.cssIgnoreRow ) ) { return; }
|
|
600 | 599 | if ( c.onRenderHeader ) {
|
601 | 600 | c.onRenderHeader.apply( $elem, [ index, c, c.$table ] );
|
602 | 601 | }
|
603 |
| - column = parseInt( $elem.attr( 'data-column' ), 10 ); |
| 602 | + // data-column stored on th or td only |
| 603 | + $th = ts.getHeaderCell( $elem ); |
| 604 | + column = parseInt( $th.attr( 'data-column' ), 10 ); |
604 | 605 | elem.column = column;
|
605 | 606 | tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
|
606 | 607 | // this may get updated numerous times if there are multiple rows
|
|
618 | 619 | }
|
619 | 620 | // add cell to headerList
|
620 | 621 | c.headerList[ index ] = elem;
|
| 622 | + $elem.addClass( ts.css.header + ' ' + c.cssHeader ); |
621 | 623 | // add to parent in case there are multiple rows
|
622 |
| - $elem |
623 |
| - .addClass( ts.css.header + ' ' + c.cssHeader ) |
624 |
| - .parent() |
| 624 | + ts.getClosest( $elem, 'tr' ) |
625 | 625 | .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow )
|
626 | 626 | .attr( 'role', 'row' );
|
627 | 627 | // allow keyboard cursor to focus on element
|
|
1179 | 1179 | }
|
1180 | 1180 | },
|
1181 | 1181 |
|
| 1182 | + // This function does NOT return closest if the $el matches the selector |
| 1183 | + getClosest : function( $el, selector ) { |
| 1184 | + return $.fn.closest ? |
| 1185 | + $el.closest( selector ) : |
| 1186 | + $el.parents( selector ).filter( ':first' ); |
| 1187 | + }, |
| 1188 | + |
| 1189 | + getHeaderCell : function( $el ) { |
| 1190 | + // jQuery v1.2.6 doesn't have closest() |
| 1191 | + if ( $.fn.closest ) { |
| 1192 | + return $el.closest( 'th, td' ); |
| 1193 | + } |
| 1194 | + return /TH|TD/.test( $el[0].nodeName ) ? |
| 1195 | + $el : |
| 1196 | + $el.parents( 'th, td' ).filter( ':first' ); |
| 1197 | + }, |
| 1198 | + |
1182 | 1199 | // nextSort (optional), lets you disable next sort text
|
1183 | 1200 | setColumnAriaLabel : function( c, $header, nextSort ) {
|
1184 | 1201 | if ( $header.length ) {
|
1185 |
| - var column = parseInt( $header.attr( 'data-column' ), 10 ), |
| 1202 | + var $th = ts.getHeaderCell( $header ), |
| 1203 | + // data-column always stored on the th/td |
| 1204 | + column = parseInt( $th.attr( 'data-column' ), 10 ), |
1186 | 1205 | vars = c.sortVars[ column ],
|
1187 | 1206 | tmp = $header.hasClass( ts.css.sortAsc ) ?
|
1188 | 1207 | 'sortAsc' :
|
|
1340 | 1359 | $cell = $( cell ),
|
1341 | 1360 | // update cache - format: function( s, table, cell, cellIndex )
|
1342 | 1361 | // no closest in jQuery v1.2.6
|
1343 |
| - tbodyIndex = $tbodies |
1344 |
| - .index( $.fn.closest ? $cell.closest( 'tbody' ) : $cell.parents( 'tbody' ).filter( ':first' ) ), |
| 1362 | + tbodyIndex = $tbodies.index( ts.getClosest( $cell, 'tbody' ) ), |
1345 | 1363 | tbcache = c.cache[ tbodyIndex ],
|
1346 |
| - $row = $.fn.closest ? $cell.closest( 'tr' ) : $cell.parents( 'tr' ).filter( ':first' ); |
| 1364 | + $row = ts.getClosest( $cell, 'tr' ); |
1347 | 1365 | cell = $cell[ 0 ]; // in case cell is a jQuery object
|
1348 | 1366 | // tbody may not exist if update is initialized while tbody is removed for processing
|
1349 | 1367 | if ( $tbodies.length && tbodyIndex >= 0 ) {
|
|
1398 | 1416 | if ( valid ) {
|
1399 | 1417 | $row = $( $row );
|
1400 | 1418 | c.$tbodies.append( $row );
|
1401 |
| - } else if ( !$row || |
| 1419 | + } else if ( |
| 1420 | + !$row || |
1402 | 1421 | // row is a jQuery object?
|
1403 | 1422 | !( $row instanceof jQuery ) ||
|
1404 | 1423 | // row contained in the table?
|
1405 |
| - ( $.fn.closest ? $row.closest( 'table' )[ 0 ] : $row.parents( 'table' )[ 0 ] ) !== c.table ) { |
| 1424 | + ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table ) |
| 1425 | + ) { |
1406 | 1426 | if ( c.debug ) {
|
1407 | 1427 | console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
|
1408 | 1428 | 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
|
|
1549 | 1569 | notMultiSort = !event[ c.sortMultiSortKey ],
|
1550 | 1570 | table = c.table,
|
1551 | 1571 | len = c.$headers.length,
|
1552 |
| - // get current column index |
1553 |
| - col = parseInt( $( cell ).attr( 'data-column' ), 10 ), |
| 1572 | + // get current column index; *always* stored on th/td |
| 1573 | + $th = ts.getHeaderCell( $( cell ) ), |
| 1574 | + col = parseInt( $th.attr( 'data-column' ), 10 ), |
1554 | 1575 | order = c.sortVars[ col ].order;
|
1555 |
| - |
1556 | 1576 | // Only call sortStart if sorting is enabled
|
1557 | 1577 | c.$table.triggerHandler( 'sortStart', table );
|
1558 | 1578 | // get current column sort order
|
|
2076 | 2096 | if ( !widget.priority ) { widget.priority = 10; }
|
2077 | 2097 | widgets[ indx ] = widget;
|
2078 | 2098 | } else if ( c.debug ) {
|
2079 |
| - console.warn( '"' + names[ indx ] + '" widget code does not exist!' ); |
| 2099 | + console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' ); |
2080 | 2100 | }
|
2081 | 2101 | }
|
2082 | 2102 | // sort widgets by priority
|
|
2148 | 2168 | c.widgetInit[ name[ index ] ] = false;
|
2149 | 2169 | }
|
2150 | 2170 | }
|
| 2171 | + c.$table.triggerHandler( 'widgetRemoveEnd', table ); |
2151 | 2172 | },
|
2152 | 2173 |
|
2153 | 2174 | refreshWidgets : function( table, doAll, dontapply ) {
|
|
2999 | 3020 |
|
3000 | 3021 | })(jQuery, window, document);
|
3001 | 3022 |
|
3002 |
| -/*! Widget: uitheme - updated 12/8/2016 (v2.28.1) */ |
| 3023 | +/*! Widget: uitheme - updated 9/27/2017 (v2.29.0) */ |
3003 | 3024 | ;(function ($) {
|
3004 | 3025 | 'use strict';
|
3005 | 3026 | var ts = $.tablesorter || {};
|
|
3016 | 3037 | active : '', // applied when column is sorted
|
3017 | 3038 | hover : '', // custom css required - a defined bootstrap style may not override other classes
|
3018 | 3039 | // icon class names
|
3019 |
| - icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header |
| 3040 | + icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header |
3020 | 3041 | iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
|
3021 |
| - iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort |
3022 |
| - iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort |
| 3042 | + iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort |
| 3043 | + iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort |
3023 | 3044 | filterRow : '', // filter row class
|
3024 | 3045 | footerRow : '',
|
3025 | 3046 | footerCells : '',
|
|
5202 | 5223 |
|
5203 | 5224 | })( jQuery );
|
5204 | 5225 |
|
5205 |
| -/*! Widget: stickyHeaders - updated 6/2/2017 (v2.28.13) *//* |
| 5226 | +/*! Widget: stickyHeaders - updated 9/27/2017 (v2.29.0) *//* |
5206 | 5227 | * Requires tablesorter v2.8+ and jQuery 1.4.3+
|
5207 | 5228 | * by Rob Garrison
|
5208 | 5229 | */
|
|
5354 | 5375 | });
|
5355 | 5376 | }
|
5356 | 5377 | },
|
| 5378 | + getLeftPosition = function() { |
| 5379 | + return $attach.length ? |
| 5380 | + parseInt($attach.css('padding-left'), 10) || 0 : |
| 5381 | + $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft(); |
| 5382 | + }, |
5357 | 5383 | resizeHeader = function() {
|
5358 | 5384 | $stickyWrap.css({
|
5359 |
| - left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 : |
5360 |
| - $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(), |
| 5385 | + left : getLeftPosition(), |
5361 | 5386 | width: $table.outerWidth()
|
5362 | 5387 | });
|
5363 | 5388 | setWidth( $table, $stickyTable );
|
|
5367 | 5392 | if (!$table.is(':visible')) { return; } // fixes #278
|
5368 | 5393 | // Detect nested tables - fixes #724
|
5369 | 5394 | nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
|
5370 |
| - var offset = $table.offset(), |
| 5395 | + var tmp, |
| 5396 | + offset = $table.offset(), |
5371 | 5397 | stickyOffset = getStickyOffset(c, wo),
|
5372 | 5398 | yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
|
5373 |
| - xWindow = $.isWindow( $xScroll[0] ), |
5374 | 5399 | attachTop = $attach.length ?
|
5375 | 5400 | ( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) :
|
5376 | 5401 | $yScroll.scrollTop(),
|
5377 | 5402 | captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
|
5378 | 5403 | scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
|
5379 | 5404 | tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
|
5380 | 5405 | isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
|
| 5406 | + state = isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide, |
| 5407 | + needsUpdating = !$stickyWrap.hasClass( state ), |
5381 | 5408 | cssSettings = { visibility : isVisible };
|
5382 | 5409 | if ($attach.length) {
|
| 5410 | + // attached sticky headers always need updating |
| 5411 | + needsUpdating = true; |
5383 | 5412 | cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
|
5384 | 5413 | }
|
5385 |
| - if (xWindow) { |
5386 |
| - // adjust when scrolling horizontally - fixes issue #143 |
5387 |
| - cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft(); |
| 5414 | + // adjust when scrolling horizontally - fixes issue #143 |
| 5415 | + tmp = getLeftPosition(); |
| 5416 | + if (tmp !== parseInt($stickyWrap.css('left'), 10)) { |
| 5417 | + needsUpdating = true; |
| 5418 | + cssSettings.left = tmp; |
5388 | 5419 | }
|
5389 | 5420 | cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop;
|
5390 |
| - $stickyWrap |
5391 |
| - .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) |
5392 |
| - .addClass( isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide ) |
5393 |
| - .css(cssSettings); |
| 5421 | + if (needsUpdating) { |
| 5422 | + $stickyWrap |
| 5423 | + .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide ) |
| 5424 | + .addClass( state ) |
| 5425 | + .css(cssSettings); |
| 5426 | + } |
5394 | 5427 | if (isVisible !== laststate || resizing) {
|
5395 | 5428 | // make sure the column widths match
|
5396 | 5429 | resizeHeader();
|
|
5509 | 5542 |
|
5510 | 5543 | })(jQuery, window);
|
5511 | 5544 |
|
5512 |
| -/*! Widget: resizable - updated 4/18/2017 (v2.28.8) */ |
| 5545 | +/*! Widget: resizable - updated 9/27/2017 (v2.29.0) */ |
5513 | 5546 | /*jshint browser:true, jquery:true, unused:false */
|
5514 | 5547 | ;(function ($, window) {
|
5515 | 5548 | 'use strict';
|
|
5836 | 5869 | vars.$target = vars.$next = null;
|
5837 | 5870 | // will update stickyHeaders, just in case, see #912
|
5838 | 5871 | c.$table.triggerHandler('stickyHeadersUpdate');
|
| 5872 | + c.$table.triggerHandler('resizableComplete'); |
5839 | 5873 | }
|
5840 | 5874 | };
|
5841 | 5875 |
|
|
0 commit comments