jenkins-bot has submitted this change and it was merged.

Change subject: Add overlay hook for user scripts.
......................................................................


Add overlay hook for user scripts.

Bug: 48502
Change-Id: I720d4fe65a6501b552dbef21cb258c027dc18867
---
A modules/hooks.txt
M modules/overlay/ext.echo.overlay.js
2 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  EBernhardson (WMF): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/hooks.txt b/modules/hooks.txt
new file mode 100644
index 0000000..bad428a
--- /dev/null
+++ b/modules/hooks.txt
@@ -0,0 +1,7 @@
+hooks.txt
+
+This documents Echo's client-side hooks:
+
+'ext.echo.overlay.beforeShowingOverlay': Before showing the Echo overlay, it is
+passed to this hook, which can modify the DOM or take other actions.
+$overlay: the jQuery-wrapped element for the overlay
diff --git a/modules/overlay/ext.echo.overlay.js 
b/modules/overlay/ext.echo.overlay.js
index e06bddd..c104ee0 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -248,6 +248,9 @@
                                                .appendTo( $( 
'#pt-notifications' ) );
                                        // Create the pokey (aka chevron)
                                        $( '.mw-echo-overlay' ).before( $( 
'<div>' ).addClass( 'mw-echo-overlay-pokey' ) );
+
+                                       mw.hook( 
'ext.echo.overlay.beforeShowingOverlay' ).fire( $overlay );
+
                                        // Show the notifications overlay
                                        $overlay.show();
                                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/64015
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I720d4fe65a6501b552dbef21cb258c027dc18867
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Bsitu <[email protected]>
Gerrit-Reviewer: EBernhardson (WMF) <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to