From: Manuel Carrasco MoƱino Date: Sun, 3 Nov 2013 11:48:06 +0000 (+0100) Subject: Force reflow instead of calling a timer X-Git-Tag: release-1.4.0~35^2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=64ba74d779f25e38b0dea080776f4272db864a79;p=gwtquery.git Force reflow instead of calling a timer --- 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 ae79422c..0a03b8ff 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 @@ -282,13 +282,17 @@ public class Transitions extends GQuery { value += (value.isEmpty() ? "" : ", ") + s + " " + attribs; } css(transition, value); + + // Force reflow so as we are assure css transition property has been set + // to the elements before setting other properties. + css("offsetHeight"); + + // Use our override css method to set all props + css(p); + + // prevent memory leak + removeData(TRANSFORM); - // schedule setting css animated properties so as we are sure css transition property has been set. - delay(0, new Function(){public void f() { - css(p); - // prevent memory leak - removeData(TRANSFORM); - }}); // restore oldTransitions in the element, and use the queue to prevent more effects being run. // TODO: Use transitionEnd events once GQuery supports non-bit events