From 64ba74d779f25e38b0dea080776f4272db864a79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Sun, 3 Nov 2013 12:48:06 +0100 Subject: [PATCH] Force reflow instead of calling a timer --- .../client/plugins/effects/Transitions.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 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 -- 2.39.5