diff --git a/js/widgets/widget-scroller.js b/js/widgets/widget-scroller.js index a02e6ee6..5e25adf7 100644 --- a/js/widgets/widget-scroller.js +++ b/js/widgets/widget-scroller.js @@ -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; + } } };