As suggested by Torsten, I have upgrade to the trunk and the problem isn't
solved.
It is partially solved if I do this:
menu.set({restrictToPageOnOpen:false});
I'm going to try to debug the Popup._afterAppear routine a little....
dperez wrote:
>
> Hi,
>
> I have a HTML page that needs vertical scrolling. When I click some
> elements in the page, a want to show a menu. That's an easy task with
> qooxdoo. To position the menu near the clicked element, I use this code:
>
> var loc = qx.html.Location;
> menu.setLocation(loc.getPageBoxLeft(element),
> loc.getPageBoxTop(element));
>
> it works ok, but when the page is vertically scrolled, I can see the popup
> positioned ok and then move upwards.
>
> I suspect of this method in qx.ui.popup.Popup, that mustn't take into
> account scrolling of the element:
>
> _afterAppear : function()
> {
> this.base(arguments);
>
> if (this.getRestrictToPageOnOpen())
> {
> var doc = qx.ui.core.ClientDocument.getInstance();
> var docWidth = doc.getClientWidth();
> var docHeight = doc.getClientHeight();
> var restrictToPageLeft = this._restrictToPageLeft;
> var restrictToPageRight = this._restrictToPageRight;
> var restrictToPageTop = this._restrictToPageTop;
> var restrictToPageBottom = this._restrictToPageBottom;
> var left = (this._wantedLeft == null) ? this.getLeft() :
> this._wantedLeft;
> var top = this.getTop();
> var width = this.getBoxWidth();
> var height = this.getBoxHeight();
>
> var oldLeft = this.getLeft();
> var oldTop = top;
>
> // NOTE: We check right and bottom first, because top and left
> should have
> // priority, when both sides are violated.
> if (left + width > docWidth - restrictToPageRight) {
> left = docWidth - restrictToPageRight - width;
> }
>
> if (top + height > docHeight - restrictToPageBottom) {
> top = docHeight - restrictToPageBottom - height;
> }
>
> if (left < restrictToPageLeft) {
> left = restrictToPageLeft;
> }
>
> if (top < restrictToPageTop) {
> top = restrictToPageTop;
> }
>
> if (left != oldLeft || top != oldTop)
> {
> var self = this;
>
> window.setTimeout(function()
> {
> self.setLeft(left);
> self.setTop(top);
> },
> 0);
> }
> }
> },
>
>
> Am I right?
> Thanks in advance for any answer.
>
--
View this message in context:
http://www.nabble.com/Possible-bug-for-popup-positioning-tf4377559.html#a12633601
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel