mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Refreshing widgets now only applies to previously installed widgets. Fixes #442
This commit is contained in:
parent
a98551a98d
commit
7c5a85c4c2
@ -1284,11 +1284,11 @@
|
||||
if (init || !(c.widgetInit[w.id])) {
|
||||
if (w.hasOwnProperty('options')) {
|
||||
wo = table.config.widgetOptions = $.extend( true, {}, w.options, wo );
|
||||
c.widgetInit[w.id] = true;
|
||||
}
|
||||
if (w.hasOwnProperty('init')) {
|
||||
w.init(table, w, c, wo);
|
||||
}
|
||||
c.widgetInit[w.id] = true;
|
||||
}
|
||||
if (!init && w.hasOwnProperty('format')) {
|
||||
w.format(table, c, wo, false);
|
||||
@ -1311,7 +1311,8 @@
|
||||
for (i = 0; i < l; i++){
|
||||
if ( w[i] && w[i].id && (doAll || $.inArray( w[i].id, cw ) < 0) ) {
|
||||
if (c.debug) { log( 'Refeshing widgets: Removing ' + w[i].id ); }
|
||||
if (w[i].hasOwnProperty('remove')) {
|
||||
// only remove widgets that have been initialized - fixes #442
|
||||
if (w[i].hasOwnProperty('remove') && c.widgetInit[w[i].id]) {
|
||||
w[i].remove(table, c, c.widgetOptions);
|
||||
c.widgetInit[w[i].id] = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user