Skip to content

Commit

Permalink
Fixed corner case when LoadingOverlay was being hidden with a long fa…
Browse files Browse the repository at this point in the history
…de out time after the target element was resized and before `resizeInterval` was triggered
  • Loading branch information
Gaspare Sganga committed Sep 24, 2018
1 parent dd80239 commit 6119dff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/loadingoverlay.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/***************************************************************************************************
LoadingOverlay - A flexible loading overlay jQuery plugin
Author : Gaspare Sganga
Version : 2.1.5
Version : 2.1.6dev
License : MIT
Documentation : https://gasparesganga.com/labs/jquery-loading-overlay/
***************************************************************************************************/
Expand Down Expand Up @@ -413,11 +413,13 @@ LoadingOverlay - A flexible loading overlay jQuery plugin

data.count--;
if (force || data.count <= 0) {
if (data.resizeIntervalId) clearInterval(data.resizeIntervalId);
overlay.fadeOut(data.settings.fade[1], function(){
overlay.animate({
"opacity" : 0
}, data.settings.fade[1], function(){
if (data.resizeIntervalId) clearInterval(data.resizeIntervalId);
$(this).remove();
container.removeData("loadingoverlay");
});
container.removeData("loadingoverlay");
}
}

Expand Down

0 comments on commit 6119dff

Please sign in to comment.