From: Leif Åstrand Date: Mon, 19 Dec 2011 10:57:28 +0000 (+0200) Subject: Set the v-theme-xxx class when the theme name is acutally known X-Git-Tag: 7.0.0.alpha1~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4c310c9cbdf1ccb23c5f851630163b2c8843c85b;p=vaadin-framework.git Set the v-theme-xxx class when the theme name is acutally known --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 50666e1674..9dc282b683 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -793,6 +793,12 @@ public class VView extends SimplePanel implements Container, ResizeHandler, // No longer added by AbstractApplicationServlet/Portlet root.removeStyleName("v-app-loading"); + String themeUri = applicationConnection.getConfiguration() + .getThemeUri(); + String themeName = themeUri.substring(themeUri.lastIndexOf('/')); + themeName = themeName.replaceAll("[^a-zA-Z0-9]", ""); + root.addStyleName("v-theme-" + themeName); + root.add(this); if (applicationConnection.getConfiguration().isStandalone()) { diff --git a/src/com/vaadin/terminal/gwt/server/AjaxPageHandler.java b/src/com/vaadin/terminal/gwt/server/AjaxPageHandler.java index 0f61cd03ef..d40a18308b 100644 --- a/src/com/vaadin/terminal/gwt/server/AjaxPageHandler.java +++ b/src/com/vaadin/terminal/gwt/server/AjaxPageHandler.java @@ -219,28 +219,19 @@ public abstract class AjaxPageHandler implements RequestHandler { throws IOException { Writer page = context.getWriter(); String style = getMainDivStyle(context); - String themeName = context.getThemeName(); /*- Add classnames; * .v-app * .v-app-loading * .v-app- - * .v-theme- + *- Additionally added from javascript: + * .v-theme- */ String appClass = "v-app-" + getApplicationCSSClassName(context.getApplication()); - String themeClass = ""; - if (themeName != null) { - themeClass = "v-theme-" + themeName.replaceAll("[^a-zA-Z0-9]", ""); - } else { - themeClass = "v-theme-" - + AbstractApplicationServlet.getDefaultTheme().replaceAll( - "[^a-zA-Z0-9]", ""); - } - - String classNames = "v-app " + themeClass + " " + appClass; + String classNames = "v-app " + appClass; if (style != null && style.length() != 0) { style = " style=\"" + style + "\"";