| 1 |
const Overlay = require( 'mobile.startup' ).Overlay; |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
function notificationsFilterOverlay( options ) { |
| 17 |
|
| 18 |
|
| 19 |
function hideOverlay() { |
| 20 |
location.hash = '#'; |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
options.$crossWikiUnreadFilter.on( 'click', hideOverlay ); |
| 25 |
options.$notifReadState.find( '.oo-ui-buttonElement' ).on( 'click', hideOverlay ); |
| 26 |
|
| 27 |
const $content = $( '<div>' ).append( |
| 28 |
$( '<div>' ) |
| 29 |
.addClass( 'notifications-filter-overlay-read-state' ) |
| 30 |
.append( options.$notifReadState ), |
| 31 |
options.$crossWikiUnreadFilter |
| 32 |
); |
| 33 |
|
| 34 |
const overlay = Overlay.make( { |
| 35 |
onBeforeExit: options.onBeforeExit, |
| 36 |
heading: '<strong>' + mw.message( 'echo-mobile-notifications-filter-title' ).escaped() + '</strong>', |
| 37 |
className: 'overlay notifications-filter-overlay notifications-overlay navigation-drawer' |
| 38 |
}, { $el: $content } ); |
| 39 |
return overlay; |
| 40 |
} |
| 41 |
|
| 42 |
module.exports = notificationsFilterOverlay; |