diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-13 11:18:54 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-18 07:55:54 +0000 |
commit | 7b565d099e0723593c7ec187303a27242e766c1c (patch) | |
tree | 14ff3da530588232b0e55b089e78142a330c6b55 /client/src | |
parent | 02855b224dbc2ce9e906644da48f2b5a3303b5fe (diff) | |
download | vaadin-framework-7b565d099e0723593c7ec187303a27242e766c1c.tar.gz vaadin-framework-7b565d099e0723593c7ec187303a27242e766c1c.zip |
Fix notification default delay
The default hiding delay should be 0ms instead of 1000ms, according to
the server side class at least.
Change-Id: I064c01b2fdc9df4cbcbd74def8e494add22ee749
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) { |