summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java
index 3113183e3e..6749d14b10 100644
--- a/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java
@@ -41,6 +41,8 @@ import com.vaadin.ui.GridLayout;
public class GridLayoutConnector extends AbstractComponentContainerConnector
implements DirectionalManagedLayout {
+ private static boolean fontLoadingCallbackRegistered = false;
+
private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
this) {
@@ -64,8 +66,26 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector
getLayoutManager().registerDependency(this,
getWidget().spacingMeasureElement);
+
+ if (!fontLoadingCallbackRegistered) {
+ fontLoadingCallbackRegistered = true;
+ registerFontLoadedCallback();
+ }
}
+ private static native void registerFontLoadedCallback()
+ /*-{
+ try {
+ if ($doc.fonts && $doc.fonts.status == 'loading') {
+ $doc.fonts.ready.then(function () {
+ $wnd.vaadin.forceLayout();
+ });
+ }
+ } catch(err) {
+ // fonts ready promise not supported by the browser
+ }
+ }-*/;
+
@Override
public void onUnregister() {
VGridLayout layout = getWidget();
@@ -151,7 +171,6 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector
cell.setComponent(componentConnector, getChildComponents());
}
-
}
private void initSize() {