]> source.dussan.org Git - vaadin-framework.git/commitdiff
Set the v-theme-xxx class when the theme name is acutally known
authorLeif Åstrand <leif@vaadin.com>
Mon, 19 Dec 2011 10:57:28 +0000 (12:57 +0200)
committerLeif Åstrand <leif@vaadin.com>
Mon, 19 Dec 2011 10:57:55 +0000 (12:57 +0200)
src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/terminal/gwt/server/AjaxPageHandler.java

index 50666e1674c5ee4df516ddc672c405b3dfb9d0c9..9dc282b6838c658d07577ce3f0c3fe2de7860efe 100644 (file)
@@ -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()) {
index 0f61cd03ef2aebb39a285e94ed9e0033497dc234..d40a18308b5cb4b5413c457ea2476a829f4751c5 100644 (file)
@@ -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-<simpleName for app class>
-         *      .v-theme-<themeName, remove non-alphanum>
+         *- Additionally added from javascript:
+         *      .v-theme-<themeName, remove non-alphanum> 
          */
 
         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 + "\"";