зеркало из https://github.com/mozilla/pjs.git
Calling both createPopup and createAnchoredPopup now.
This commit is contained in:
Родитель
e777df7f0d
Коммит
d6cdb51453
|
@ -215,14 +215,30 @@ XULPopupListenerImpl::LaunchPopup(nsIDOMEvent* anEvent)
|
|||
if (domWindow != nsnull) {
|
||||
printf("Can call createPopup!\n");
|
||||
|
||||
// Find out if we're anchored.
|
||||
nsString anchorAlignment;
|
||||
element->GetAttribute("popupanchor", anchorAlignment);
|
||||
|
||||
nsString popupAlignment("topleft");
|
||||
element->GetAttribute("popupalign", popupAlignment);
|
||||
|
||||
if (anchorAlignment == "") {
|
||||
// We aren't anchored. Create on the point.
|
||||
// Retrieve our x and y position.
|
||||
PRInt32 xPos, yPos;
|
||||
anEvent->GetScreenX(&xPos); // XXX I need to figure out frames for alignment purposes
|
||||
anEvent->GetScreenX(&xPos);
|
||||
anEvent->GetScreenY(&yPos);
|
||||
|
||||
domWindow->CreatePopup(element, popupContent,
|
||||
xPos, yPos,
|
||||
type, "point");
|
||||
type, popupAlignment);
|
||||
}
|
||||
else {
|
||||
// We're anchored. Pass off to the window, and let it figure out
|
||||
// from the frame where it wants to put us.
|
||||
domWindow->CreateAnchoredPopup(element, popupContent,
|
||||
anchorAlignment, type, popupAlignment);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(global);
|
||||
}
|
||||
|
|
|
@ -215,14 +215,30 @@ XULPopupListenerImpl::LaunchPopup(nsIDOMEvent* anEvent)
|
|||
if (domWindow != nsnull) {
|
||||
printf("Can call createPopup!\n");
|
||||
|
||||
// Find out if we're anchored.
|
||||
nsString anchorAlignment;
|
||||
element->GetAttribute("popupanchor", anchorAlignment);
|
||||
|
||||
nsString popupAlignment("topleft");
|
||||
element->GetAttribute("popupalign", popupAlignment);
|
||||
|
||||
if (anchorAlignment == "") {
|
||||
// We aren't anchored. Create on the point.
|
||||
// Retrieve our x and y position.
|
||||
PRInt32 xPos, yPos;
|
||||
anEvent->GetScreenX(&xPos); // XXX I need to figure out frames for alignment purposes
|
||||
anEvent->GetScreenX(&xPos);
|
||||
anEvent->GetScreenY(&yPos);
|
||||
|
||||
domWindow->CreatePopup(element, popupContent,
|
||||
xPos, yPos,
|
||||
type, "point");
|
||||
type, popupAlignment);
|
||||
}
|
||||
else {
|
||||
// We're anchored. Pass off to the window, and let it figure out
|
||||
// from the frame where it wants to put us.
|
||||
domWindow->CreateAnchoredPopup(element, popupContent,
|
||||
anchorAlignment, type, popupAlignment);
|
||||
}
|
||||
}
|
||||
NS_RELEASE(global);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче