diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/com/vaadin/client/ui/VNotification.java | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/client/src/com/vaadin/client/ui/VNotification.java b/client/src/com/vaadin/client/ui/VNotification.java index d89dcb7634..af7e429340 100644 --- a/client/src/com/vaadin/client/ui/VNotification.java +++ b/client/src/com/vaadin/client/ui/VNotification.java @@ -79,7 +79,7 @@ public class VNotification extends VOverlay { private static final ArrayList<VNotification> notifications = new ArrayList<VNotification>(); private boolean infiniteDelay = false; - private int cssAnimationDelay = -1; + private int hideDelay = 0; private int x = -1; private int y = -1; @@ -139,10 +139,10 @@ public class VNotification extends VOverlay { private void setDelay(int delayMsec) { if (delayMsec < 0) { infiniteDelay = true; - cssAnimationDelay = 0; + hideDelay = 0; } else { infiniteDelay = false; - cssAnimationDelay = delayMsec; + hideDelay = delayMsec; } } @@ -260,11 +260,6 @@ public class VNotification extends VOverlay { } } - private void hideWithoutDelay() { - cssAnimationDelay = 0; - hide(); - } - @Override public void hide() { // Run only once @@ -297,11 +292,11 @@ public class VNotification extends VOverlay { public void run() { VNotification.super.hide(); } - }.schedule(cssAnimationDelay); + }.schedule(hideDelay); } else { - if (cssAnimationDelay > 0) { - AnimationUtil.setAnimationDelay(getElement(), - cssAnimationDelay + "ms"); + if (hideDelay > 0) { + AnimationUtil.setAnimationDelay(getElement(), hideDelay + + "ms"); } VNotification.super.hide(); @@ -399,12 +394,12 @@ public class VNotification extends VOverlay { if (infiniteDelay || temporaryStyle == STYLE_SYSTEM) { if (type == Event.ONCLICK) { if (DOM.isOrHasChild(getElement(), DOM.eventGetTarget(event))) { - hideWithoutDelay(); + hide(); return false; } } else if (type == Event.ONKEYDOWN && event.getKeyCode() == KeyCodes.KEY_ESCAPE) { - hideWithoutDelay(); + hide(); return false; } if (temporaryStyle == STYLE_SYSTEM) { |