Topic on Talk:Notifications

How to insert a JS hook after mw-echo-overlay?

5
Incnis Mrsi (talkcontribs)

There are no problems with running a personal script after downloading of the dedicated Special:Notifications page, but I do not know how to do it after downloading of the notifications popup as

<div style="display: block;" class="mw-echo-overlay"> </div>

It seems to me that hooks added with jQuery(document).ready() are not called then. There are docs at http://api.jquery.com/ but I am not a DHTML expert and can’t find easily the thing I need. Suggestions?

Legoktm (talkcontribs)

To clarify, are you trying to run some JavaScript after the flyout is shown? I don't think there is currently a way to do that, but we can add a hook point if you have a use-case for it.

Incnis Mrsi (talkcontribs)

Yes, I’m trying to run some JavaScript after "mw-echo-overlay" is shown. Of course, I have not access to the MediaWiki installation (it is Wikipedia).

Legoktm (talkcontribs)

Ok, turns out a hook for this already exists.

mw.hook('ext.echo.overlay.beforeShowingOverlay').add( function( $overlay ) {
// javascript you want to run
} );
Reply to "How to insert a JS hook after mw-echo-overlay?"