ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

popup: emite popup-after-show event on popup widget #464

Closed wkeese closed 8 years ago

wkeese commented 8 years ago

Make delite/popup emit a "popup-after-show" event on popup widgets, so that they can do final drawing adjustments based on position. This is analogous to dijit's onShow() function call and is needed by the deliteful/Tooltip widget (see ibm-js/deliteful#652).

The event will have the following properties (in addition to standard event properties), which are the same properties returned by popup.open():

// position of popup
h: ...,
w: ...,
x: ...,
y: ...,

// position of anchor
aroundNodePos: {
    h: ...,
    w: ...,
    x: ...,
    y: ...
}, 

// corner (or position) on popup and aroundNode that were aligned with each other
corner: "BM",
aroundCorner: "TM",

// the space that was available to position the popup
spaceAvailable: {
    w: ...,
    h: ...
}

Not to be confused though with "delite-after-show", which is emitted by DisplayContainer on the container (rather than the widget which was just shown).