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,8 +880,10 @@ ts.scroller = {
remove : function( c, wo ) {
var $wrap = wo.scroller_$container,
namespace = c.namespace + 'tsscroller';
c.$table.off( namespace );
$( window ).off( namespace );
if ( $wrap ) {
c.$table
.off( namespace )
.insertBefore( $wrap )
.find( 'thead' )
.removeClass( tscss.scrollerHideElement )
@ -896,9 +898,9 @@ ts.scroller = {
.not( '.' + tscss.filterDisabled )
.prop( 'disabled', false );
$wrap.remove();
$( window ).off( namespace );
c.isScrolling = false;
}
}
};