]> source.dussan.org Git - vaadin-framework.git/commitdiff
Moving error indicator to right side of a caption
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Mon, 19 May 2008 12:58:58 +0000 (12:58 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Mon, 19 May 2008 12:58:58 +0000 (12:58 +0000)
svn changeset:4552/svn branch:trunk

WebContent/ITMILL/themes/default/caption/caption.css
src/com/itmill/toolkit/terminal/gwt/client/Caption.java

index 1f2e4526758f21811fa571cccf7337a72a8de621..629967ba1c6567df96678c3aec5fd2f06bbc2c72 100644 (file)
@@ -9,10 +9,9 @@
 .i-errorindicator {
        width: 10px;
        height: 16px;
-       padding-right:2px;
-       display: block;
-       float:left;
-       background: transparent url(../icons/16/error.png) no-repeat;
+       padding-right:13px;
+       display: inline;
+       background: transparent url(icons/16/error.png) no-repeat top right;
        vertical-align: middle;
 }
 
index 1ffd59f4dbbe50748c55c5c7fd80a1a96981c1bb..d68eeaba8ae16c3853b4c09b0cbf79437378c6eb 100644 (file)
@@ -57,7 +57,7 @@ public class Caption extends HTML {
                 errorIndicatorElement = DOM.createDiv();
                 DOM.setElementProperty(errorIndicatorElement, "className",
                         "i-errorindicator");
-                DOM.insertChild(getElement(), errorIndicatorElement, 0);
+                DOM.appendChild(getElement(), errorIndicatorElement);
             }
             if (errorMessage == null) {
                 errorMessage = new ErrorMessage();
@@ -73,7 +73,7 @@ public class Caption extends HTML {
             if (icon == null) {
                 icon = new Icon(client);
 
-                DOM.appendChild(getElement(), icon.getElement());
+                DOM.insertChild(getElement(), icon.getElement(), 0);
             }
             icon.setUri(uidl.getStringAttribute("icon"));
             isEmpty = false;
@@ -88,7 +88,9 @@ public class Caption extends HTML {
         if (uidl.hasAttribute("caption")) {
             if (captionText == null) {
                 captionText = DOM.createSpan();
-                DOM.appendChild(getElement(), captionText);
+                DOM
+                        .insertChild(getElement(), captionText,
+                                icon == null ? 0 : 1);
             }
             String c = uidl.getStringAttribute("caption");
             if (c == null) {