Closed
Bug 793157
Opened 13 years ago
Closed 13 years ago
Add a method to move a anchored popup to an new relative position
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: enndeakin, Assigned: enndeakin)
References
Details
Attachments
(1 file, 1 obsolete file)
|
10.52 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
The attached patch adds:
popup.moveToAnchor(anchorElement, position, x, y, attributesOverride);
which anchors an open popup if it isn't already and sets the position and offsets accordingly.
| Assignee | ||
Comment 1•13 years ago
|
||
Attachment #663375 -
Attachment is obsolete: true
| Assignee | ||
Updated•13 years ago
|
Attachment #663534 -
Flags: review?(neil)
Comment 2•13 years ago
|
||
Why not just call openPopup again to anchor it to a new element?
Comment 3•13 years ago
|
||
Bug 792295 comment 4 suggests that openPopup gives up too early for already-open panels.
| Assignee | ||
Comment 4•13 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #2)
> Why not just call openPopup again to anchor it to a new element?
Because openPopup is used to open a popup, not move one.
Comment 5•13 years ago
|
||
See also bug 798226 for a similar problem when the sizeTo method is used.
Comment 6•13 years ago
|
||
Comment on attachment 663534 [details] [diff] [review]
updated patch
Sorry for the delay. The code looks good apart from the below nit but I haven't tried it out yet.
> NS_IMETHODIMP
>+nsPopupBoxObject::MoveToAnchor(nsIDOMElement* aAnchorElement,
>+ const nsAString& aPosition,
>+ int32_t aXPos, int32_t aYPos,
>+ bool aAttributesOverride)
>+{
>+ nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
Unused. (Compare MoveTo which doesn't even bother.)
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment 8•13 years ago
|
||
hrm, looks like this was landed without the r+ marked, and without the nit addressed?
| Assignee | ||
Comment 9•13 years ago
|
||
Oops, I thought this was reviewed ok. I can address the comment, or backout as desired.
Comment 10•13 years ago
|
||
Comment on attachment 663534 [details] [diff] [review]
updated patch
2nd nit (but 1st nit is more important):
>+function runTest(id)
>+{
>+ $("popup").openPopup($("button1"), "after_start", 0, 0);
>+}
You take advantage of optional arguments here...
>+ popup.moveToAnchor($("button1"), "after_start", 0, 8, false);
...but you don't bother doing it here, when you could.
Attachment #663534 -
Flags: review?(neil) → review+
Comment 11•13 years ago
|
||
Updated•6 years ago
|
Component: XP Toolkit/Widgets: Menus → XUL
You need to log in
before you can comment on or make changes to this bug.
Description
•