From 75b4f578ae9666fa8e3fbe8a2c15bfe15dc55a19 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 8 Dec 2014 17:10:08 -0500 Subject: [PATCH] Dimmer now can be clicked even before element has finished animating in, #1363 --- src/definitions/modules/sidebar.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/definitions/modules/sidebar.js b/src/definitions/modules/sidebar.js index 04a0486a4..d3f69fd79 100644 --- a/src/definitions/modules/sidebar.js +++ b/src/definitions/modules/sidebar.js @@ -425,6 +425,7 @@ $.fn.sidebar = function(parameters) { module.set.transition(); module.repaint(); animate = function() { + module.bind.clickaway(); module.add.bodyCSS(); module.set.animating(); module.set.visible(); @@ -436,14 +437,14 @@ $.fn.sidebar = function(parameters) { }; transitionEnd = function(event) { if( event.target == $transition[0] ) { - $transition.off(transitionEvent + eventNamespace, transitionEnd); + $transition.off(transitionEvent + elementNamespace, transitionEnd); module.remove.animating(); - module.bind.clickaway(); module.bind.scrollLock(); $.proxy(callback, element)(); } }; - $transition.on(transitionEvent + eventNamespace, transitionEnd); + $transition.off(transitionEvent + elementNamespace); + $transition.on(transitionEvent + elementNamespace, transitionEnd); requestAnimationFrame(animate); }, @@ -476,7 +477,7 @@ $.fn.sidebar = function(parameters) { }; transitionEnd = function(event) { if( event.target == $transition[0] ) { - $transition.off(transitionEvent + eventNamespace, transitionEnd); + $transition.off(transitionEvent + elementNamespace, transitionEnd); module.remove.animating(); module.remove.transition(); module.remove.bodyCSS(); @@ -486,7 +487,8 @@ $.fn.sidebar = function(parameters) { $.proxy(callback, element)(); } }; - $transition.on(transitionEvent + eventNamespace, transitionEnd); + $transition.off(transitionEvent + elementNamespace); + $transition.on(transitionEvent + elementNamespace, transitionEnd); requestAnimationFrame(animate); },