diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-08-30 06:27:04 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-08-30 06:27:04 +0000 |
commit | 38eaf39b4f0932c74b088401aa66753f7fe5cd49 (patch) | |
tree | 5a7d224acc574e83df5e9644479445cea436b27e | |
parent | 2536b6b520efde1720e67bc69d6281ff600d712c (diff) | |
download | vaadin-framework-38eaf39b4f0932c74b088401aa66753f7fe5cd49.tar.gz vaadin-framework-38eaf39b4f0932c74b088401aa66753f7fe5cd49.zip |
#7496 Theme files loaded from a css file using AlphaImageLoader only works in the root context
svn changeset:20719/svn branch:6.7
-rw-r--r-- | WebContent/VAADIN/themes/runo/table/table.css | 10 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java | 31 |
2 files changed, 25 insertions, 16 deletions
diff --git a/WebContent/VAADIN/themes/runo/table/table.css b/WebContent/VAADIN/themes/runo/table/table.css index 2b2bcbce05..f09dc0e3bb 100644 --- a/WebContent/VAADIN/themes/runo/table/table.css +++ b/WebContent/VAADIN/themes/runo/table/table.css @@ -158,15 +158,7 @@ tr.v-table-row-odd:hover { /* IE6 hack */ .v-ie6 .v-table-scrollposition { background: transparent; - /* - AlphaImageLoader uses src attribute relative to host page, not CSS - We need multiple different filters because we cannot be sure how host page is served compared to theme resources - TODO: This actually does not work as expected, since only the last filter is applied. Can we chain filters together (i.e. contain all versions on one line)? - */ - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../../VAADIN/themes/default/table/img/scroll-position-bg.png", sizingMethod="scale"); - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../VAADIN/themes/default/table/img/scroll-position-bg.png", sizingMethod="scale"); - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="VAADIN/themes/default/table/img/scroll-position-bg.png", sizingMethod="scale"); - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/VAADIN/themes/default/table/img/scroll-position-bg.png", sizingMethod="scale"); + zoom: expression((function(e) {vaadin.setAlphaImageLoader(e, "../runo/table/img/scroll-position-bg.png", "scale")})(this)); } diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 6787b36022..f87ec51b93 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -361,7 +361,7 @@ public class ApplicationConfiguration implements EntryPoint { cmd.execute(); } callbacks.clear(); - } else if(widgetsLoading == 0 && deferredWidgetLoader != null) { + } else if (widgetsLoading == 0 && deferredWidgetLoader != null) { deferredWidgetLoader.trigger(); } @@ -377,17 +377,17 @@ public class ApplicationConfiguration implements EntryPoint { int communicationFree = 0; int nextWidgetIndex = 0; private boolean pending; - + public DeferredWidgetLoader() { schedule(5000); } public void trigger() { - if(!pending) { + if (!pending) { schedule(FREE_CHECK_TIMEOUT); } } - + @Override public void schedule(int delayMillis) { super.schedule(delayMillis); @@ -438,13 +438,14 @@ public class ApplicationConfiguration implements EntryPoint { return communicationFree < FREE_LIMIT; } } - + private static DeferredWidgetLoader deferredWidgetLoader; - + public void onModuleLoad() { + boolean isIE6 = BrowserInfo.get().isIE6(); // Enable IE6 Background image caching - if (BrowserInfo.get().isIE6()) { + if (isIE6) { enableIE6BackgroundImageCache(); } // Prepare VConsole for debugging @@ -473,9 +474,25 @@ public class ApplicationConfiguration implements EntryPoint { }); initConfigurations(); + + // Set up hack for finding transparent theme resources in IE6 + if (isIE6 && !unstartedApplications.isEmpty()) { + String themeUri = unstartedApplications.get(0).getThemeUri(); + initAlphaImageLoader(themeUri); + } + startNextApplication(); } + private static native void initAlphaImageLoader(String themeBase) + /*-{ + // Used to enable defining AlphaImageLoader filters with the src path relative to the theme directory for IE6 + $wnd.vaadin.setAlphaImageLoader = function(element, image, sizingMethod) { + element.runtimeStyle.zoom="1"; //Reset the zoom definition to avoid running the expression again + element.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+themeBase+'/'+image+"', sizingMethod='"+(themeBase||"crop")+"')"; + } + }-*/; + // From ImageSrcIE6 private static native void enableIE6BackgroundImageCache() /*-{ |