Skip to content

Conversation

darkred
Copy link
Contributor

@darkred darkred commented May 5, 2021

Closes #123

Test URLs

https://github.com/

Screenshot

2021-05-05_225054


Note to reviewers

I use .removeAttribute('open') to close the dropdown.

@fregante
Copy link
Owner

fregante commented May 6, 2021

Thank you! I’ll make sure it works correctly soon

@darkred
Copy link
Contributor Author

darkred commented May 7, 2021

I made a change so that the popup close gets canceled if you re-mousenter quick enough, within 1 sec (1000 ms)
(and updated the screenshot in the OP).

@darkred
Copy link
Contributor Author

darkred commented Jun 4, 2021

Hi @fregante
Is there any way I can assist you in making the PR complete ?

 
Some notes:

  • About the popup closing to be canceled if you re-mousenter quick enough,
    the interval I currently have is 1000 msec, but I think it should be 500 msec. What do you think?

  • If I click a "Mark as done" and then move the mouse away so that the popup gets closed,
    then if I move the mouse to reopen the popup, clicking another "Mark as done"
    unfortunately causes the relevant "Marked x notifications as read" message to be displayed multiple times: e.g.
    2021-06-04_201123
    So, I tried changing removeAttribute() into remove() the popup altogether + reopening it (see code below)
    but unfortunately the issue remains:

    using remove() :
    		if (options.closeOnMouseleave) {
    			let timer;
    			select('.NPG-dropdown').addEventListener('mouseleave', () => {
    				// timer = setTimeout(closeDropdown, 500);
    				timer = setTimeout(() => {closeDropdown(); createNotificationsDropdown();}, 500);
    			});
    			select('.NPG-dropdown').addEventListener('mouseenter', () => {
    				clearTimeout(timer);
    			});
    		}
    
    // ...
    
    function closeDropdown() {
    	// select('.NPG-container[open]').removeAttribute('open');
    	select('.NPG-container').remove();
    }

@darkred
Copy link
Contributor Author

darkred commented Sep 4, 2021

Thank you! I’ll make sure it works correctly soon

@fregante Have you changed your mind? Do you find this PR is not salvageable? Should I close this?

@fregante
Copy link
Owner

fregante commented Sep 4, 2021

I've been on Safari for a year and I haven't used some of my extensions since 😅 so you can just leave this open until someone reviews it

@tjx666
Copy link
Collaborator

tjx666 commented Jul 28, 2024

Welcome to contribute here: https://github.com/tjx666/github-notifications-preview/tree/main

@fregante fregante merged commit 5216edc into fregante:master Aug 3, 2024
@darkred

This comment was marked as off-topic.

@fregante

This comment was marked as off-topic.

@darkred

This comment was marked as off-topic.

@fregante

This comment was marked as resolved.

@darkred

This comment was marked as off-topic.

@fregante

This comment was marked as off-topic.

Repository owner locked and limited conversation to collaborators Aug 6, 2024
@darkred darkred deleted the popup-to-close-when-you-move-mouse-away branch August 6, 2024 21:44
@fregante
Copy link
Owner

I just submitted this version to the chrome web store. They should publish it within 24 hours

Repository owner unlocked this conversation Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The popup to close when you move the mouse away from its area
4 participants