Skip to content

Commit

Permalink
fixed issue where rapidly clicking collection button multiple times w…
Browse files Browse the repository at this point in the history
…ould break the button
  • Loading branch information
GillesVermeulen committed Nov 15, 2018
1 parent f3a2210 commit 9350b97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/dataTables.buttons.js
Expand Up @@ -923,10 +923,12 @@ Buttons.background = function ( show, className, fade, insertPoint ) {
.addClass( className )
.css( 'display', 'none' )
.insertAfter( insertPoint )
.stop()
.fadeIn( fade );
}
else {
$('div.'+className)
.stop()
.fadeOut( fade, function () {
$(this)
.removeClass( className )
Expand Down Expand Up @@ -1185,12 +1187,12 @@ $.extend( _dtButtons, {
var collection = $(this).siblings('.dt-button-collection');

if ( collection.length ) {
collection.fadeOut( config.fade, function () {
collection.stop().fadeOut( config.fade, function () {
collection.detach();
} );

$(this).removeAttr( 'aria-expanded' );
}

$(this).removeAttr( 'aria-expanded' );
});

$('div.dt-button-background').off( 'click.dtb-collection' );
Expand Down Expand Up @@ -1232,6 +1234,7 @@ $.extend( _dtButtons, {
.addClass( config.collectionLayout )
.css( 'display', 'none' )
.insertAfter( insertPoint )
.stop()
.fadeIn( config.fade );

var position = config._collection.css( 'position' );
Expand Down

0 comments on commit 9350b97

Please sign in to comment.