mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Core: Add "widgetRemoveEnd" event. Fixes #1430
This commit is contained in:
parent
c108de305c
commit
8c2f14b8fd
@ -2130,6 +2130,7 @@
|
||||
c.widgetInit[ name[ index ] ] = false;
|
||||
}
|
||||
}
|
||||
c.$table.triggerHandler( 'widgetRemoveEnd', table );
|
||||
},
|
||||
|
||||
refreshWidgets : function( table, doAll, dontapply ) {
|
||||
|
@ -982,13 +982,19 @@ jQuery(function($){
|
||||
test has widget function
|
||||
************************************************/
|
||||
QUnit.test( 'has & remove zebra widget', function(assert) {
|
||||
assert.expect(3);
|
||||
var done = assert.async();
|
||||
assert.expect(4);
|
||||
c2.widgets = [ 'zebra' ];
|
||||
$table2.trigger('applyWidgets');
|
||||
assert.equal( ts.hasWidget( table2, 'zebra'), true, 'table has zebra widget (using table element object)' );
|
||||
assert.equal( ts.hasWidget( $table2, 'zebra'), true, 'table has zebra widget (using jQuery table object)' );
|
||||
ts.removeWidget( table2, 'zebra' );
|
||||
assert.equal( zebra() && c2.widgets.length === 0, false, 'zebra removed' );
|
||||
$table2.trigger('applyWidgets', function() {
|
||||
assert.equal( ts.hasWidget( table2, 'zebra'), true, 'table has zebra widget (using table element object)' );
|
||||
assert.equal( ts.hasWidget( $table2, 'zebra'), true, 'table has zebra widget (using jQuery table object)' );
|
||||
$table2.one( 'widgetRemoveEnd', function() {
|
||||
assert.ok( true, 'widgetRemoveEnd fired');
|
||||
assert.equal( zebra() && c2.widgets.length === 0, false, 'zebra removed' );
|
||||
done();
|
||||
});
|
||||
ts.removeWidget( table2, 'zebra' );
|
||||
});
|
||||
});
|
||||
|
||||
/************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user