]> source.dussan.org Git - gwtquery.git/commitdiff
Fix lenght check. Reflow before setting transition
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Sun, 3 Nov 2013 15:23:39 +0000 (16:23 +0100)
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Sun, 3 Nov 2013 15:23:39 +0000 (16:23 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java

index ec0271331ddb8adb79fa32083f0d36f3e66b9b9b..21324b1a1e5d87edf7b75b169c504af7bf02b8fb 100644 (file)
@@ -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<String> props = filterPropertyNames(p);
     String value  = "";
     for (String s : props) {