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

Value ShowDegrade Collection (separate keys) #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martincayouette
Copy link

The collection that kept track of event handlers did not take in account the value showDegrade. We are now storing event handlers on separate keys according to the value of this parameter.

…unt the value showDegrade. We are now storing event handlers on separate keys according to the value of this parameter.
@WickyNilliams
Copy link
Owner

Hey martin, excuse the delay in response.

I'll have to think about this one. Is the current behaviour actually much of an issue? If you want one handler to degrade in old browsers, you probably want all handlers for that media query to degrade - as that would be the media query where you switch to a desktop style?

Preferably I'd also like unit tests to accompany any new functionality. It worries me that this didn't break any tests to be honest (speaks more about my unit tests than your changes).

@masyl
Copy link

masyl commented May 29, 2013

Hi Nick,

I worked with Martin on this pull request. The reason that your tests are not failing is that we we're careful to make the changes backward compatible.

We had to make this fix because we we're having an unpredictable result when using then API.

We are currently doing the mobile adaptation of a large site. The various behaviors/components we have are decoupled from each-others and each of them is responsible declaring their own "enquire" events. Some are declaring events that are fallbacks, others are declaring events that are not fallbacks, with the same media-queries.

Without this fix, your library would only respect the "showDegrade" argument for the first event registered. The second registration would simply be ignored.

Your tests would have to handle such a scenario (we already have a second large project with the same dylema in the works)

@WickyNilliams
Copy link
Owner

OK thanks for providing some context, I definitely agree with the idea - what you described is how I always envisioned enquire being used. I'll have a look over everything tomorrow when I have some time free and get back to you.

Thanks again

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