]> source.dussan.org Git - vaadin-framework.git/commitdiff
Ensuring that caption styles do not leak in deep component trees. Connected to #1897
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 3 Jul 2008 14:59:51 +0000 (14:59 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 3 Jul 2008 14:59:51 +0000 (14:59 +0000)
svn changeset:5037/svn branch:trunk

WebContent/ITMILL/themes/default/orderedlayout/orderedlayout.css
WebContent/ITMILL/themes/default/styles.css
WebContent/ITMILL/themes/tests-tickets/styles.css
src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java

index 635fe1a3bf55eb9ce353c728c97aaece44b6586a..60832fd639f9510432abb2490209afa7e49215f0 100644 (file)
        padding-left: 8px;
 }
 
-.i-orderedlayout-w2 .i-caption * { 
-       float:left; 
-       display: block;
-}
-.i-orderedlayout-w-e {
-       float:left;     
-}
-       
-.i-orderedlayout-w2 .i-caption:after, .i-orderedlayout-w2:after {
+/* Placing error indicator right after the widget with empty caption */
+.i-orderedlayout-w:after, .i-orderedlayout-c:after {
        content: ".";
        display: block;
        height: 0;
     clear: both;
     visibility: hidden;
 }
-               
-.i-orderedlayout-w2 .i-caption, .i-orderedlayout-w2 {
-       display: inline-block;
-}
-
-/* Hides from IE-mac \*/
-* html .i-orderedlayout-w2 .i-caption, * html .i-orderedlayout-w2 { height: 1%; }
-.i-orderedlayout-w2 .i-caption, .i-orderedlayout-w2 { display: block; }
-/* End hide from IE-mac */
-
-/*
-.i-errorindicator {
-       background:transparent url(../icons/16/error.png) no-repeat scroll right top;
-       height:16px;
-       width:10px;
-       margin-left: 3px;
-}
-*/
\ No newline at end of file
+.i-orderedlayout-c * { float:left; display: block;}
+.i-orderedlayout-w-e { float:left;}
+* html .i-orderedlayout-c, * html .i-orderedlayout-w { height: 1%; }
+.i-orderedlayout-c, .i-orderedlayout-w { display: block; }
\ No newline at end of file
index f66b4bd465270c9d226ee16ed8a42e6f6f35c681..ce0a2657d356a0d2b658cbe99aa1fa631332aae6 100644 (file)
@@ -717,39 +717,18 @@ input.i-modified,
        padding-left: 8px;
 }
 
-.i-orderedlayout-w2 .i-caption * { 
-       float:left; 
-       display: block;
-}
-.i-orderedlayout-w-e {
-       float:left;     
-}
-       
-.i-orderedlayout-w2 .i-caption:after, .i-orderedlayout-w2:after {
+/* Placing error indicator right after the widget with empty caption */
+.i-orderedlayout-w:after, .i-orderedlayout-c:after {
        content: ".";
        display: block;
        height: 0;
     clear: both;
     visibility: hidden;
 }
-               
-.i-orderedlayout-w2 .i-caption, .i-orderedlayout-w2 {
-       display: inline-block;
-}
-
-/* Hides from IE-mac \*/
-* html .i-orderedlayout-w2 .i-caption, * html .i-orderedlayout-w2 { height: 1%; }
-.i-orderedlayout-w2 .i-caption, .i-orderedlayout-w2 { display: block; }
-/* End hide from IE-mac */
-
-/*
-.i-errorindicator {
-       background:transparent url(icons/16/error.png) no-repeat scroll right top;
-       height:16px;
-       width:10px;
-       margin-left: 3px;
-}
-*/
+.i-orderedlayout-c * { float:left; display: block;}
+.i-orderedlayout-w-e { float:left;}
+* html .i-orderedlayout-c, * html .i-orderedlayout-w { height: 1%; }
+.i-orderedlayout-c, .i-orderedlayout-w { display: block; }
 .i-panel,
 .i-panel-caption,
 .i-panel-content,
index 7f558c42b839ef62729ed7bb8a3c3f9d7993f8a9..f7d190e226ba8af5e3dbb99d7db753b120079ca5 100644 (file)
@@ -17,7 +17,6 @@
        background-color: #eee; 
 }
 
-
 /*****************************************************************************/
 /* Ticket 1857                                                               */
 /*****************************************************************************/
index d0d8cb5f1fd0149bc3da8bf40d320cdc5e328300..c4e1f175eafdcad716f41dac57b1db2a60a2d970 100644 (file)
@@ -290,7 +290,8 @@ public abstract class IOrderedLayout extends Panel implements Container {
                     if (after) {
                         DOM.appendChild(getElement(), captionElement);
                         DOM.setElementAttribute(getElement(), "class",
-                                "i-orderedlayout-w2");
+                                "i-orderedlayout-w");
+                        caption.addStyleName("i-orderedlayout-c");
                         widget.addStyleName("i-orderedlayout-w-e");
                     } else {
                         DOM.insertChild(getElement(), captionElement, 0);
@@ -305,11 +306,13 @@ public abstract class IOrderedLayout extends Panel implements Container {
                     DOM.removeChild(getElement(), firstElement);
                     DOM.appendChild(getElement(), firstElement);
                     DOM.setElementAttribute(getElement(), "class",
-                            after ? "i-orderedlayout-w2" : "");
+                            after ? "i-orderedlayout-w" : "");
                     if (after) {
+                        caption.addStyleName("i-orderedlayout-c");
                         widget.addStyleName("i-orderedlayout-w-e");
                     } else {
                         widget.removeStyleName("i-orderedlayout-w-e");
+                        caption.removeStyleName("i-orderedlayout-w-c");
                     }
                 }
 
@@ -319,6 +322,7 @@ public abstract class IOrderedLayout extends Panel implements Container {
                     caption = null;
                     DOM.setElementAttribute(getElement(), "class", "");
                     widget.removeStyleName("i-orderedlayout-w-e");
+                    caption.removeStyleName("i-orderedlayout-w-c");
                 }
             }
         }