Browse Source

Fix for #2504 - IFilterSelect popup in wrong position

svn changeset:6748/svn branch:trunk
tags/6.7.0.beta1
Artur Signell 15 years ago
parent
commit
f28f3bb8a5
1 changed files with 13 additions and 3 deletions
  1. 13
    3
      src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java

+ 13
- 3
src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java View File



private int popupOuterPadding = -1; private int popupOuterPadding = -1;


private int topPosition;

SuggestionPopup() { SuggestionPopup() {
super(true, false, true); super(true, false, true);
menu = new SuggestionMenu(); menu = new SuggestionMenu();


menu.setSuggestions(currentSuggestions); menu.setSuggestions(currentSuggestions);
final int x = IFilterSelect.this.getAbsoluteLeft(); final int x = IFilterSelect.this.getAbsoluteLeft();
int y = tb.getAbsoluteTop();
y += tb.getOffsetHeight();
setPopupPosition(x, y);
topPosition = tb.getAbsoluteTop();
topPosition += tb.getOffsetHeight();
setPopupPosition(x, topPosition);

final int first = currentPage * PAGELENTH final int first = currentPage * PAGELENTH
+ (nullSelectionAllowed && currentPage > 0 ? 0 : 1); + (nullSelectionAllowed && currentPage > 0 ? 0 : 1);
final int last = first + currentSuggestions.size() - 1; final int last = first + currentSuggestions.size() - 1;
} }
} else { } else {
top = getPopupTop(); top = getPopupTop();
/*
* Take popup top margin into account. getPopupTop() returns the
* top value including the margin but the value we give must not
* include the margin.
*/
int topMargin = (top - topPosition);
top -= topMargin;
} }


// fetch real width (mac FF bugs here due GWT popups overflow:auto ) // fetch real width (mac FF bugs here due GWT popups overflow:auto )

Loading…
Cancel
Save