From ea5723e8cae0ab1da09e56b385807d1fdf0f3434 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Thu, 9 Jan 2014 15:56:19 +0100 Subject: [PATCH] Transition: Disable animationEnd callback on transition reset. Fixes rare race condition with modals where animationEnd callback on dimmer could fire before modal's one, calling .transition('reset') on modal right before animationEnd event for it arrives, causing module.complete callback to restore incorect conditions, making modal visible when it shouldn't be, causing next modals to misbehave. --- src/modules/transition.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/transition.js b/src/modules/transition.js index 5aab59770..7b29d2f9c 100755 --- a/src/modules/transition.js +++ b/src/modules/transition.js @@ -148,6 +148,7 @@ $.fn.transition = function() { reset: function() { module.debug('Resetting animation to beginning conditions'); + $module.off(animationEnd); module.restore.conditions(); module.hide(); module.remove.animating(); @@ -809,4 +810,4 @@ $.fn.transition.settings = { }; -})( jQuery, window , document ); \ No newline at end of file +})( jQuery, window , document );