From: Arno Renevier Date: Fri, 28 Oct 2011 22:18:31 +0000 (+0200) Subject: fixes: message did not appear when showing it too quickly after hiding it X-Git-Tag: v.0.3.7 X-Git-Url: https://dev.renevier.net/?p=syj.git;a=commitdiff_plain;h=79315e38eea4482f92049e0d1b40fb35f8f4a3ff fixes: message did not appear when showing it too quickly after hiding it --- diff --git a/public/js/utils.js b/public/js/utils.js index eab837d..a81262f 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -467,7 +467,9 @@ Element.addMethods('div', (function() { if (supportsTransition && hasOpacityTransition(div)) { div.observe(endTransitionEventName, function() { div.stopObserving(endTransitionEventName); - div.hide(); + if (!div.getOpacity()) { // in case show has been called in-between + div.hide(); + } }); div.setOpacity(0); } else { @@ -490,7 +492,7 @@ Element.addMethods('div', (function() { } function clearMessages(div) { - if (div.visible()) { + if (div.getOpacity()) { hide(div); } return div; @@ -517,7 +519,7 @@ Element.addMethods('div', (function() { } div.appendChild(node); - if (!div.visible()) { + if (!div.getOpacity()) { show(div); } return div;