From d4a20f4ca151ea86bc5d76f6215850b5e73a8a17 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 8 Nov 2007 14:06:42 +0000 Subject: [PATCH] fixed issues with img paths and appuri not ending with slash svn changeset:2763/svn branch:trunk --- .../terminal/gwt/client/ui/ICustomLayout.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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; -- 2.39.5