mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Mobile Special:Notifications: Properly close overlay on selection
Calling overlay.hide() doesn't invoke the onBeforeExit handler (anymore? not sure if it ever did), so we have to call this handler ourselves when manually closing the overlay. Bug: T258954 Change-Id: Ife5926241c0b8473607c14df0f89c794728566dd
This commit is contained in:
parent
db8b71f67f
commit
bf1a124475
|
@ -12,14 +12,16 @@ var Overlay = mw.mobileFrontend.require( 'mobile.startup' ).Overlay;
|
|||
*/
|
||||
function notificationsFilterOverlay( options ) {
|
||||
var $content, overlay;
|
||||
// Initialize
|
||||
options.$crossWikiUnreadFilter.on( 'click', function () {
|
||||
overlay.hide();
|
||||
} );
|
||||
|
||||
options.$notifReadState.find( '.oo-ui-buttonElement' ).on( 'click', function () {
|
||||
overlay.hide();
|
||||
} );
|
||||
// Don't call overlay.hide(), because that doesn't invoke the onBeforeExit callback (T258954)
|
||||
// Instead, change the hash, so that the OverlayManager hides the overlay for us
|
||||
function hideOverlay() {
|
||||
location.hash = '#';
|
||||
}
|
||||
|
||||
// Close overlay when a selection is made
|
||||
options.$crossWikiUnreadFilter.on( 'click', hideOverlay );
|
||||
options.$notifReadState.find( '.oo-ui-buttonElement' ).on( 'click', hideOverlay );
|
||||
|
||||
$content = $( '<div>' ).append(
|
||||
$( '<div>' )
|
||||
|
|
Loading…
Reference in a new issue