Ver código fonte

Fix for #2234 - IE ComboBox popup menu width

svn changeset:6027/svn branch:trunk
tags/6.7.0.beta1
Artur Signell 15 anos atrás
pai
commit
a605dbdf45

+ 19
- 0
src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java Ver arquivo

@@ -104,6 +104,7 @@ public class IFilterSelect extends Composite implements Paintable, Field,
private boolean isPagingEnabled = true;

private long lastAutoClosed;
private int menuLeftMargin = -1;

SuggestionPopup() {
super(true, false, true);
@@ -303,6 +304,24 @@ public class IFilterSelect extends Composite implements Paintable, Field,
naturalMenuWidth = desiredWidth;
}

if (BrowserInfo.get().isIE()) {
// Take left margin into account
if (menuLeftMargin == -1) {
int menuOffsetLeft = menu.getElement().getOffsetLeft();
int menuParentOffsetLeft = getContainerElement()
.getOffsetLeft();
menuLeftMargin = menuOffsetLeft - menuParentOffsetLeft;
}

/*
* IE requires us to specify the width for the container
* element. Otherwise it will be 100% wide
*/
int rootWidth = naturalMenuWidth + menuLeftMargin;
DOM.setStyleAttribute(getContainerElement(), "width", rootWidth
+ "px");
}

if (offsetHeight + getPopupTop() > Window.getClientHeight()
+ Window.getScrollTop()) {
// popup on top of input instead

Carregando…
Cancelar
Salvar