Scroller: prevent error on destroy when not applied. See #965

This commit is contained in:
Mottie 2015-07-15 06:50:53 -05:00
parent dd80e3c88f
commit 7b8553068d

View File

@ -880,24 +880,26 @@ ts.scroller = {
remove : function( c, wo ) {
var $wrap = wo.scroller_$container,
namespace = c.namespace + 'tsscroller';
c.$table
.off( namespace )
.insertBefore( $wrap )
.find( 'thead' )
.removeClass( tscss.scrollerHideElement )
.children( 'tr.' + tscss.headerRow )
.children()
.attr( 'tabindex', 0 )
.end()
.find( '.' + tscss.filterRow )
.removeClass( tscss.scrollerHideElement + ' ' + tscss.filterRowHide );
c.$table
.find( '.' + tscss.filter )
.not( '.' + tscss.filterDisabled )
.prop( 'disabled', false );
$wrap.remove();
c.$table.off( namespace );
$( window ).off( namespace );
c.isScrolling = false;
if ( $wrap ) {
c.$table
.insertBefore( $wrap )
.find( 'thead' )
.removeClass( tscss.scrollerHideElement )
.children( 'tr.' + tscss.headerRow )
.children()
.attr( 'tabindex', 0 )
.end()
.find( '.' + tscss.filterRow )
.removeClass( tscss.scrollerHideElement + ' ' + tscss.filterRowHide );
c.$table
.find( '.' + tscss.filter )
.not( '.' + tscss.filterDisabled )
.prop( 'disabled', false );
$wrap.remove();
c.isScrolling = false;
}
}
};