mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Filter: filterInit delayed to prevent the beloved filter event spam. Fixes #668
This commit is contained in:
parent
9e1746cc2f
commit
9dea6c656e
@ -699,19 +699,24 @@ ts.filter = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.$table.trigger('filterFomatterUpdate');
|
c.$table.trigger('filterFomatterUpdate');
|
||||||
if (!wo.filter_initialized) {
|
// trigger init after setTimeout to prevent multiple filterStart/End/Init triggers
|
||||||
// filter widget initialized
|
setTimeout(function(){
|
||||||
wo.filter_initialized = true;
|
if (!wo.filter_initialized) {
|
||||||
c.$table.trigger('filterInit', c);
|
// filter widget initialized
|
||||||
}
|
wo.filter_initialized = true;
|
||||||
|
c.$table.trigger('filterInit', c);
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
// if filter widget is added after pager has initialized; then set filter init flag
|
// if filter widget is added after pager has initialized; then set filter init flag
|
||||||
if (c.pager && c.pager.initialized && !wo.filter_initialized) {
|
setTimeout(function(){
|
||||||
wo.filter_initialized = true;
|
if (c.pager && c.pager.initialized && !wo.filter_initialized) {
|
||||||
c.$table
|
wo.filter_initialized = true;
|
||||||
.trigger('filterFomatterUpdate')
|
c.$table
|
||||||
.trigger('filterInit', c);
|
.trigger('filterFomatterUpdate')
|
||||||
}
|
.trigger('filterInit', c);
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
|
|
||||||
},
|
},
|
||||||
setDefaults: function(table, c, wo) {
|
setDefaults: function(table, c, wo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user