mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Parser: input-select parser no longer binds to non-tablesorter tables. Fixes #633
This commit is contained in:
parent
f932d2687e
commit
5ce66aebfe
@ -522,7 +522,7 @@
|
||||
<ul>
|
||||
<li><a href="example-parsers-dates.html">Assorted date parsers</a> (<span class="version">v2.8</span>; <span class="version updated">v2.14</span>; includes weekday, month, two-digit year & <a href="http://sugarjs.com/dates">sugar.js</a> date parsers).</li>
|
||||
<li><a href="example-parsers-ignore-articles.html">Ignore leading articles parser</a> (Ignore "A", "An" and "The" in titles) (<span class="version">v2.8</span>).</li>
|
||||
<li><a href="example-widget-grouping.html">Input/select parsers</a> (used by Grouping rows widget) (<span class="version">v2.8</span>; <span class="version updated">v2.16.2</span>).</li>
|
||||
<li><a href="example-widget-grouping.html">Input/select parsers</a> (used by Grouping rows widget) (<span class="version">v2.8</span>; <span class="version updated">v2.17.1</span>).</li>
|
||||
<li><a href="example-parsers-metric.html">Metric parser</a> (<span class="version">v2.8</span>).</li>
|
||||
<li><a href="example-parsers-feet-inch-fraction.html">Feet-inch-fraction parser</a> (<span class="version">v2.8</span>).</li>
|
||||
<li><a href="example-parsers-ip-address.html">IPv6 address parser</a> (<span class="version">v2.12</span>).</li>
|
||||
|
@ -71,17 +71,20 @@
|
||||
$(window).load(function(){
|
||||
// this flag prevents the updateCell event from being spammed
|
||||
// it happens when you modify input text and hit enter
|
||||
var alreadyUpdating = false;
|
||||
$('table').find('tbody').on('change', 'select, input', function(e){
|
||||
var alreadyUpdating = false,
|
||||
t = $.tablesorter.css.table || 'tablesorter';
|
||||
// bind to .tablesorter (default class name)
|
||||
$('.' + t).find('tbody').on('change', 'select, input', function(e){
|
||||
if (!alreadyUpdating) {
|
||||
var $tar = $(e.target),
|
||||
$cell = $tar.closest('td'),
|
||||
$table = $cell.closest('table'),
|
||||
indx = $cell[0].cellIndex,
|
||||
c = $table[0].config,
|
||||
c = $table[0].config || false,
|
||||
$hdr = c && c.$headers && c.$headers.eq(indx);
|
||||
// don't use updateCell if column is set to "sorter-false" and "filter-false"
|
||||
if ($hdr.length && $hdr.hasClass('sorter-false') && $hdr.hasClass('filter-false')){
|
||||
// abort if not a tablesorter table, or
|
||||
// don't use updateCell if column is set to "sorter-false" and "filter-false", or column is set to "parser-false"
|
||||
if ( !c || ( $hdr && $hdr.length && ( $hdr.hasClass('parser-false') || ($hdr.hasClass('sorter-false') && $hdr.hasClass('filter-false')) ) ) ){
|
||||
return false;
|
||||
}
|
||||
alreadyUpdating = true;
|
||||
|
Loading…
Reference in New Issue
Block a user