Skip to content

Commit dd00450

Browse files
authored
Cleanup popup closing code (#150)
1 parent fd3acf0 commit dd00450

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/github-notifications-preview.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function createNotificationsDropdown() {
8484
// https://github.com/tanmayrajani/notifications-preview-github/issues/50
8585
const onClick = event => {
8686
if (!event.metaKey && !event.ctrlKey && !event.shiftKey && event.target.closest('a[href]')) {
87-
$('.modal-backdrop').click();
87+
closeDropdown();
8888
}
8989
};
9090

@@ -181,7 +181,7 @@ async function openDropdown({currentTarget: indicator}) {
181181
}
182182

183183
function closeDropdown() {
184-
$('.NPG-container[open]').removeAttribute('open');
184+
$('details.NPG-container[open] > summary').click();
185185
}
186186

187187
// When the dropdown is open, GitHub's modal blocks all links outside the dropdown.

0 commit comments

Comments
 (0)