From: Leif Åstrand Date: Fri, 23 Mar 2012 12:20:33 +0000 (+0200) Subject: Another attempt with the icon styles for IE8 (#8313) X-Git-Tag: 7.0.0.alpha2~222 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ecdbb3d9a8898ca66a8fe6327279efb9ddc09cc7;p=vaadin-framework.git Another attempt with the icon styles for IE8 (#8313) --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index a7a12df840..82bbff9d85 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -946,16 +946,13 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, selectedItemIcon.setStyleName("v-icon"); selectedItemIcon.addLoadHandler(new LoadHandler() { public void onLoad(LoadEvent event) { + if (BrowserInfo.get().isIE8()) { + // IE8 needs some help to discover it should reposition the + // text field + forceReflow(); + } updateRootWidth(); updateSelectedIconPosition(); - /* - * Workaround for an IE bug where the text is positioned below - * the icon (#3991) - */ - if (BrowserInfo.get().isIE()) { - Util.setStyleTemporarily(tb.getElement(), "paddingLeft", - "0"); - } } }); @@ -1151,32 +1148,22 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, if (selectedItemIcon.isAttached()) { panel.remove(selectedItemIcon); if (BrowserInfo.get().isIE8()) { + // IE8 needs some help to discover it should reposition the + // text field forceReflow(); } updateRootWidth(); } } else { - selectedItemIcon.setUrl(iconUri); panel.insert(selectedItemIcon, 0); - if (BrowserInfo.get().isIE8()) { - forceReflow(); - } + selectedItemIcon.setUrl(iconUri); updateRootWidth(); updateSelectedIconPosition(); } } private void forceReflow() { - Style style = tb.getElement().getStyle(); - - String oldZoom = style.getProperty("zoom"); - style.setProperty("zoom", "1"); - - // Forces reflow because style has changed - tb.getOffsetWidth(); - - // Restore old style - style.setProperty("zoom", oldZoom); + Util.setStyleTemporarily(tb.getElement(), "zoom", "1"); } /**