]> dev.renevier.net Git - syj.git/commitdiff
fixes: message did not appear when showing it too quickly after hiding it v.0.3.7
authorArno Renevier <arno@renevier.net>
Fri, 28 Oct 2011 22:18:31 +0000 (00:18 +0200)
committerArno Renevier <arno@renevier.net>
Fri, 28 Oct 2011 22:18:31 +0000 (00:18 +0200)
public/js/utils.js

index eab837dc2b4e099000f7c2779a15a486b41a05ac..a81262fac5a89db5ae9151831225f078209c66fa 100644 (file)
@@ -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;