diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-11-08 14:06:42 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2007-11-08 14:06:42 +0000 |
commit | d4a20f4ca151ea86bc5d76f6215850b5e73a8a17 (patch) | |
tree | 847d36546cb50e5a26026ec0459bb05b7e9b1a5a | |
parent | b6e7385cf7aa215d6dfe26b4071425d1f7ce26f3 (diff) | |
download | vaadin-framework-d4a20f4ca151ea86bc5d76f6215850b5e73a8a17.tar.gz vaadin-framework-d4a20f4ca151ea86bc5d76f6215850b5e73a8a17.zip |
fixed issues with img paths and appuri not ending with slash
svn changeset:2763/svn branch:trunk
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java | 15 |
1 files changed, 14 insertions, 1 deletions
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; |