mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
alignChar: don't add align character when no content is right of it
This commit is contained in:
parent
6521510e97
commit
e3558664f8
@ -90,6 +90,7 @@ td:nth-child(3) .ts-align-right i {
|
||||
<h3><a href="#">Notes</a></h3>
|
||||
<div>
|
||||
<ul>
|
||||
<li>In <span class="version">v2.18.5</span>, if there is nothing to the right of the set align character, then the align character will not be added; this prevents hanging decimals like <code>3000.</code>.<p></p></li>
|
||||
<li>This widget will <strong>only work</strong> in tablesorter version 2.8+ and jQuery version 1.7+.</li>
|
||||
<li>The widget is still in "beta", so options & functionality may change without warning; and, it has not been thoroughly tested!</li>
|
||||
<li>Make sure to include the CSS shown below to maintain the alignment.</li>
|
||||
@ -283,7 +284,7 @@ td:nth-child(3) .ts-align-right i {
|
||||
</tr>
|
||||
<tr>
|
||||
<td>zyx 12</td>
|
||||
<td>0.2</td>
|
||||
<td>.2</td>
|
||||
<td>Llama = llove it</td>
|
||||
<td>http://aliens.nasa.gov/</td>
|
||||
</tr>
|
||||
|
@ -83,10 +83,10 @@ ts.alignChar = {
|
||||
for (rowIndex = 0; rowIndex < len; rowIndex++) {
|
||||
alignChar = $(wo.alignChar_wrap).length ? $(wo.alignChar_wrap).html(v.align)[0].outerHTML : v.align;
|
||||
$row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
|
||||
last = right[rowIndex].slice(v.align.length);
|
||||
$row.find('td').eq(v.column).html(
|
||||
'<span class="ts-align-wrap"><span class="ts-align-left" style="' + wLeft + '">' + left[rowIndex] + '</span>' +
|
||||
'<span class="ts-align-right" style="' + wRight + '">' + alignChar +
|
||||
right[rowIndex].slice(v.align.length) + '</span></span>'
|
||||
'<span class="ts-align-right" style="' + wRight + '">' + ( last.length ? alignChar + last : '' ) + '</span></span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -134,7 +134,8 @@ ts.addWidget({
|
||||
c.$table.trigger('refreshAlign');
|
||||
}
|
||||
},
|
||||
remove : function(table, c, wo){
|
||||
remove : function(table, c, wo, refreshing){
|
||||
if (refreshing) { return; }
|
||||
c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
|
||||
ts.alignChar.remove(table, c, this.column);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user