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#a12477562
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel