Browse Source

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
tags/7.3.0.beta1
Jouni Koivuviita 10 years ago
parent
commit
7b565d099e

+ 2
- 2
WebContent/VAADIN/themes/base/notification/notification.scss View File

@@ -41,7 +41,7 @@
margin: 0;
}
.#{$primaryStyleName}-animate-out {
@include animation(animate-out 400ms 1s);
@include animation(v-notification-animate-out 400ms);
}

.#{$primaryStyleName} {
@@ -65,7 +65,7 @@

}

@include keyframes(animate-out) {
@include keyframes(v-notification-animate-out) {
100% {
opacity: 0;
}

+ 3
- 3
WebContent/VAADIN/themes/valo/shared/_notification.scss View File

@@ -45,7 +45,7 @@ $v-notification-title-color: $v-focus-color !default;
}

.#{$primary-stylename}-animate-out {
@include animation(valo-placeholder-animate-out 150ms 1s, valo-anim-fade-out 150ms 1s);
@include animation(valo-placeholder-animate-out 150ms, valo-anim-fade-out 150ms);

&.v-position-left,
&.v-position-right {
@@ -206,7 +206,7 @@ $v-notification-title-color: $v-focus-color !default;
}

&.v-Notification-animate-out {
@include animation(valo-placeholder-animate-out 200ms 1s, valo-anim-slide-out-up 200ms 1s);
@include animation(valo-placeholder-animate-out 200ms, valo-anim-slide-out-up 200ms);
}
}
}
@@ -220,7 +220,7 @@ $v-notification-title-color: $v-focus-color !default;
}

&.v-Notification-animate-out {
@include animation(valo-placeholder-animate-out 200ms 1s, valo-anim-slide-out-down 200ms 1s);
@include animation(valo-placeholder-animate-out 200ms, valo-anim-slide-out-down 200ms);
}
}
}

+ 9
- 14
client/src/com/vaadin/client/ui/VNotification.java View File

@@ -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) {

Loading…
Cancel
Save