]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixed issues with img paths and appuri not ending with slash
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 8 Nov 2007 14:06:42 +0000 (14:06 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 8 Nov 2007 14:06:42 +0000 (14:06 +0000)
svn changeset:2763/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java

index 1901a2b010afe72db1534b04faa08a5d12dd4ca1..24862dc56bdb7564052bf9b4e7792b98404c9fe3 100644 (file)
@@ -156,7 +156,13 @@ public class ICustomLayout extends ComplexPanel implements Paintable,
                while (parent != null && !(parent instanceof IView))
                        parent = parent.getParent();
                if (parent != null && ((IView) parent).getTheme() != null) {
-                       prefixImgSrcs(getElement(), "../ITMILL/themes/"
+                       String prefix;
+                       if(uriEndsWithSlash()) {
+                               prefix = "../ITMILL/themes/";
+                       } else {
+                               prefix = "ITMILL/themes/";
+                       }
+                       prefixImgSrcs(getElement(), prefix
                                        + ((IView) parent).getTheme() + "/layouts/");
                } else {
                        throw (new IllegalStateException(
@@ -167,6 +173,13 @@ public class ICustomLayout extends ComplexPanel implements Paintable,
                
        }
 
+       private native boolean uriEndsWithSlash() /*-{
+               var path =  $wnd.location.pathname;
+               if(path.charAt(path.length - 1) == "/")
+                       return true;
+               return false;
+       }-*/;
+
        private boolean hasTemplate() {
                if (currentTemplate == null)
                        return false;