Core: fix hasWidget error

This commit is contained in:
Mottie 2015-07-23 07:25:02 -05:00
parent 565a0e6c1f
commit a0d29c99f4
10 changed files with 27 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 07-22-2015 (v2.22.2)*/
/*! tablesorter (FORK) - updated 07-23-2015 (v2.22.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1700,8 +1700,8 @@
ts.widgets.push(widget);
};
ts.hasWidget = function(table, name){
$table = $(table);
ts.hasWidget = function( $table, name ) {
$table = $( $table );
return $table.length && $table[0].config && $table[0].config.widgetInit[name] || false;
};

File diff suppressed because one or more lines are too long

View File

@ -1698,8 +1698,8 @@
ts.widgets.push(widget);
};
ts.hasWidget = function(table, name){
$table = $(table);
ts.hasWidget = function( $table, name ) {
$table = $( $table );
return $table.length && $table[0].config && $table[0].config.widgetInit[name] || false;
};

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 07-22-2015 (v2.22.2)*/
/*! tablesorter (FORK) - updated 07-23-2015 (v2.22.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 07-22-2015 (v2.22.2)*/
/*! tablesorter (FORK) - updated 07-23-2015 (v2.22.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1706,8 +1706,8 @@
ts.widgets.push(widget);
};
ts.hasWidget = function(table, name){
$table = $(table);
ts.hasWidget = function( $table, name ) {
$table = $( $table );
return $table.length && $table[0].config && $table[0].config.widgetInit[name] || false;
};

View File

@ -1688,8 +1688,8 @@
ts.widgets.push(widget);
};
ts.hasWidget = function(table, name){
$table = $(table);
ts.hasWidget = function( $table, name ) {
$table = $( $table );
return $table.length && $table[0].config && $table[0].config.widgetInit[name] || false;
};

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 07-22-2015 (v2.22.2)*/
/*! tablesorter (FORK) - updated 07-23-2015 (v2.22.2)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {

View File

@ -749,6 +749,15 @@ $(function(){
assert.equal( zebra(), true, 'zebra is applied after update' );
});
/************************************************
test has widget function
************************************************/
QUnit.test( "has zebra widget", function(assert) {
assert.expect(2);
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)' );
});
/************************************************
check destroy method
************************************************/