You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although mySidePane.show("content") will fire the delite-after-show event, mySidePane.show() will not.
It's because mySidePane.show() shows the <d-side-pane> itself rather than one of the children of the <d-side-pane>, and thus it doesn't execute the code in DisplayContainer.
Seems like a bug, although technically the description of the delite-after-show event in DisplayContainer.js does specifically use the word "child":
/** * Dispatched after child is shown. * @example * document.addEventListener("delite-after-show", function (evt) { * console.log("just displayed child", evt.child); * }); * @event module:delite/DisplayContainer#delite-after-show * @property {Element} child - reference to child element */
Still, seems counterintuitive.
The text was updated successfully, but these errors were encountered:
wkeese
changed the title
Sidepane: doesn't fire delite-after-show event
SidePane: doesn't fire delite-after-show event
Feb 19, 2016
@cjolif any feelings on what behavior makes sense? And if not delite-after-show, should there be another event for when the show animation completes? A colleague was asking about this so he could focus a field in the SidePane after it opened.
The reason for this behavior is the reason for the before/after show events at first. The reason for this series of events was to allow an application framework (dapp for example) to be warned when a container wants to display a child element. This was giving the app framework the opportunity to possibly dynamically instanciate the child (from JSON, from Database, whatever) before it is displayed.
I guess this means that indeed to achieve the use-case you mention another specific event should be added to the side pane.
OK. I guess then the naming of the existing events is unfortunate, since delite-after-show sounds like it applies to SidePane (and perhaps other non-DisplayContainer widgets too).
Although
mySidePane.show("content")
will fire thedelite-after-show
event,mySidePane.show()
will not.It's because
mySidePane.show()
shows the<d-side-pane>
itself rather than one of the children of the<d-side-pane>
, and thus it doesn't execute the code in DisplayContainer.Seems like a bug, although technically the description of the
delite-after-show
event in DisplayContainer.js does specifically use the word "child":Still, seems counterintuitive.
The text was updated successfully, but these errors were encountered: