Pager: Fix code alignment

This commit is contained in:
Rob Garrison 2016-06-20 12:18:41 -05:00
parent 7c1d4183c8
commit 7d16a2e4f6
No known key found for this signature in database
GPG Key ID: 0A42D160D71978E1

View File

@ -1120,18 +1120,18 @@
// see #486 // see #486
ts.showError = function( table, xhr, settings, exception ) { ts.showError = function( table, xhr, settings, exception ) {
var $row, var $row,
$table = $( table ), $table = $( table ),
c = $table[0].config, c = $table[0].config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
errorRow = c.pager && c.pager.cssErrorRow || errorRow = c.pager && c.pager.cssErrorRow ||
wo && wo.pager_css && wo.pager_css.errorRow || wo && wo.pager_css && wo.pager_css.errorRow ||
'tablesorter-errorRow', 'tablesorter-errorRow',
typ = typeof xhr, typ = typeof xhr,
valid = true, valid = true,
message = '', message = '',
removeRow = function(){ removeRow = function(){
c.$table.find( 'thead' ).find( '.' + errorRow ).remove(); c.$table.find( 'thead' ).find( '.' + errorRow ).remove();
}; };
if ( !$table.length ) { if ( !$table.length ) {
console.error('tablesorter showError: no table parameter passed'); console.error('tablesorter showError: no table parameter passed');
@ -1158,13 +1158,13 @@
if ( message === '' ) { if ( message === '' ) {
if ( typ === 'object' ) { if ( typ === 'object' ) {
message = message =
xhr.status === 0 ? 'Not connected, verify Network' : xhr.status === 0 ? 'Not connected, verify Network' :
xhr.status === 404 ? 'Requested page not found [404]' : xhr.status === 404 ? 'Requested page not found [404]' :
xhr.status === 500 ? 'Internal Server Error [500]' : xhr.status === 500 ? 'Internal Server Error [500]' :
exception === 'parsererror' ? 'Requested JSON parse failed' : exception === 'parsererror' ? 'Requested JSON parse failed' :
exception === 'timeout' ? 'Time out error' : exception === 'timeout' ? 'Time out error' :
exception === 'abort' ? 'Ajax Request aborted' : exception === 'abort' ? 'Ajax Request aborted' :
'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']'; 'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']';
} else if ( typ === 'string' ) { } else if ( typ === 'string' ) {
// keep backward compatibility (external usage just passes a message string) // keep backward compatibility (external usage just passes a message string)
message = xhr; message = xhr;
@ -1176,16 +1176,16 @@
// allow message to include entire row HTML! // allow message to include entire row HTML!
$row = ( /tr\>/.test(message) ? $(message) : $('<tr><td colspan="' + c.columns + '">' + message + '</td></tr>') ) $row = ( /tr\>/.test(message) ? $(message) : $('<tr><td colspan="' + c.columns + '">' + message + '</td></tr>') )
.click( function() { .click( function() {
$( this ).remove(); $( this ).remove();
}) })
// add error row to thead instead of tbody, or clicking on the header will result in a parser error // add error row to thead instead of tbody, or clicking on the header will result in a parser error
.appendTo( c.$table.find( 'thead:first' ) ) .appendTo( c.$table.find( 'thead:first' ) )
.addClass( errorRow + ' ' + c.selectorRemove.slice(1) ) .addClass( errorRow + ' ' + c.selectorRemove.slice(1) )
.attr({ .attr({
role : 'alert', role : 'alert',
'aria-live' : 'assertive' 'aria-live' : 'assertive'
}); });
}; };