]> source.dussan.org Git - vaadin-framework.git/commitdiff
Support font icons in MenuItems (#13372)
authorJohannes Dahlström <johannesd@vaadin.com>
Wed, 26 Feb 2014 13:20:55 +0000 (15:20 +0200)
committerJuho Nurminen <juho@vaadin.com>
Thu, 27 Feb 2014 14:35:48 +0000 (14:35 +0000)
Change-Id: I2a85f77f68d701baa804bd3e6d55fa737bb4cc0e

client/src/com/vaadin/client/ui/VMenuBar.java

index 6c994777a71f7d0c4f12b64348655f1d0531b117..b6aee9277986b403c3ccc282987ace67b630233c 100644 (file)
@@ -226,11 +226,9 @@ public class VMenuBar extends SimpleFocusablePanel implements
 
             itemHTML.append("<span class=\"" + getStylePrimaryName()
                     + "-menuitem-caption\">");
-            if (item.hasAttribute("icon")) {
-                itemHTML.append("<img src=\""
-                        + Util.escapeAttribute(client.translateVaadinUri(item
-                                .getStringAttribute("icon"))) + "\" class=\""
-                        + ImageIcon.CLASSNAME + "\" alt=\"\" />");
+            Icon icon = client.getIcon(item.getStringAttribute("icon"));
+            if (icon != null) {
+                itemHTML.append(icon.getElement().getString());
             }
             String itemText = item.getStringAttribute("text");
             if (!htmlContentAllowed) {