Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the 'Hover to Show' newtab option; Only add mouse move listener w… #138

Merged
merged 1 commit into from Oct 29, 2015

Conversation

ahal
Copy link
Contributor

@ahal ahal commented Oct 28, 2015

…hen 'Always On' is selected

@ahal
Copy link
Contributor Author

ahal commented Oct 28, 2015

Heh, I forgot how to git there for a minute.

@@ -82,6 +84,7 @@ function updateThumbnails() {
thumb.style.backgroundImage = thumb.dataset.newPreview;
thumb.removeEventListener('mouseover', mouseOverListener);
thumb.removeEventListener('mouseout', mouseOutListener);
window.addEventListener('mousemove', mouseMoveListener);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also remove this in cases 1 and 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.. for the record, this switch statement doesn't match up with the 'toggle' one above for some reason. 'case 2' seems to be the 'Always On' option and I think that's the only case that needs the mousemove listener.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, it doesn't match up because the toggle one is describing the next state.
And I agree it only needs the listener for case 2, so we should have "window.removeEventListener" in the other two cases, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, I misunderstood what you meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

bwinton added a commit that referenced this pull request Oct 29, 2015
Fix the 'Hover to Show' newtab option.
Only add mouse move listener when 'Always On' is selected.
@bwinton bwinton merged commit 6f2680a into bwinton:master Oct 29, 2015
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.

None yet

3 participants