From 987c20f78e1f5b46aafb203f219845f1d3cfe60d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Sun, 3 Nov 2013 16:23:39 +0100 Subject: [PATCH] Fix lenght check. Reflow before setting transition --- .../gwt/query/client/plugins/effects/Transitions.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index ec027133..21324b1a 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -82,7 +82,7 @@ public class Transitions extends GQuery { } public void setFromString(String prop, String ...val) { - if (val.length == 0 && val[0] instanceof String) { + if (val.length == 1 && val[0] instanceof String) { String[] vals = ((String)val[0]).split("[\\s*,\\s*]"); set(prop, vals); } else { @@ -276,9 +276,11 @@ public class Transitions extends GQuery { if (easing == null) { easing = EasingCurve.ease; } + + // Force reflow before setting transitions, so as we do not animate previous values + css("offsetHeight"); String attribs = duration + "ms" + " " + easing.toString() + " " + delay + "ms"; - List props = filterPropertyNames(p); String value = ""; for (String s : props) { -- 2.39.5