From: Matti Tahvonen Date: Thu, 8 Nov 2007 14:06:42 +0000 (+0000) Subject: fixed issues with img paths and appuri not ending with slash X-Git-Tag: 6.7.0.beta1~5621 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d4a20f4ca151ea86bc5d76f6215850b5e73a8a17;p=vaadin-framework.git fixed issues with img paths and appuri not ending with slash svn changeset:2763/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java index 1901a2b010..24862dc56b 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java @@ -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;