Don't let the error icon get clipped when the text is short.

On Chrome (and possibly others), an inline element like span doesn't enlarge
its size to cover its content, so the 1px place holder wasn't taking effect.

To ensure the minimum height of 16px, make it an inline-block element. I'm
not entirely sure how an inline-block element with no fixed width would behave,
but with a bit of casual testing, the text inside seems to wrap OK.
This commit is contained in:
Kohsuke Kawaguchi committed 2013-04-19 10:11:28 -07:00
1 parent 22d1175ac6
commit 368d8c7394
2 files changed
+4 -6

No files matched your search

+1 -3
View File
@@ -1264,9 +1264,7 @@ public class Util {
* @since 1.173
*/
public static String wrapToErrorSpan(String s) {
s = "<span class=error><img src='"+
Stapler.getCurrentRequest().getContextPath()+ Jenkins.RESOURCE_PATH+
"/images/none.gif' height=16 width=1>"+s+"</span>";
s = "<span class=error style='display:inline-block'>"+s+"</span>";
return s;
}