]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6304 Make embeddeds align correctly in centered table cells
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Mon, 7 Feb 2011 13:08:17 +0000 (13:08 +0000)
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Mon, 7 Feb 2011 13:08:17 +0000 (13:08 +0000)
svn changeset:17183/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java

index 2f7bb5b1dae96397b16f184779189b942bb5faa1..6f966e2775fd47f7c544beb0bd59dcce34b46ac2 100644 (file)
@@ -13,6 +13,7 @@ import com.google.gwt.dom.client.Node;
 import com.google.gwt.dom.client.NodeList;
 import com.google.gwt.dom.client.ObjectElement;
 import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.Display;
 import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.event.dom.client.DomEvent.Type;
 import com.google.gwt.event.shared.EventHandler;
@@ -307,6 +308,9 @@ public class VEmbedded extends HTML implements Paintable {
         super.onBrowserEvent(event);
         if (DOM.eventGetType(event) == Event.ONLOAD) {
             if ("image".equals(type)) {
+                // display: inline-block in order for embeddeds to be centered
+                // in centered table columns.
+                getElement().getStyle().setDisplay(Display.INLINE_BLOCK);
                 updateElementDynamicSizeFromImage();
             }
             Util.notifyParentOfSizeChange(this, true);