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

Custom event for style updates #63

Merged
merged 5 commits into from
Aug 21, 2015
Merged

Custom event for style updates #63

merged 5 commits into from
Aug 21, 2015

Conversation

henryruhs
Copy link
Contributor

Can be tested this way:

$(window).on('viewport-units-buggyfill-style', function (event) {
    alert(event.type);
});

@henryruhs
Copy link
Contributor Author

It would be great to have custom viewport-units-buggyfill-init too but I don't know the right place were to put it to...

@rodneyrehm
Copy link
Owner

PR for issue #62


This is going to fail in IE10 and older, because it does not know the CustomEvent constructor. You'll need to add a polyfill for this.

It would be great to have custom viewport-units-buggyfill-init too but I don't know the right place were to put it to...

what do you intend to do with it? I'd say before initializing the hacks is a good time?

@henryruhs
Copy link
Contributor Author

I'd like to add and remove classes to hide parts in the website that will be processed and look ugly before the buggyfill finished processing.

$(window).on('viewport-units-buggyfill-init viewport-units-buggyfill-style', function (event) {
    if (event.type === 'viewport-units-buggyfill-init') {
    //add buggy class to hide something
    } else {
    //remove buggy class to hide something
    }
});

@henryruhs
Copy link
Contributor Author

Were is the best place to add the polyfill inside your core?

@rodneyrehm
Copy link
Owner

Were is the best place to add the polyfill inside your core?

since we're talking about few lines of code, I guess I'd just copy-paste it (with linking to the source) before the private functions.

@henryruhs
Copy link
Contributor Author

Let me test it once you merged it to the master.

@rodneyrehm
Copy link
Owner

Why do you need this merged to master to test it?

bower link $moduleName
npm link $moduleName

@henryruhs
Copy link
Contributor Author

I allready tested it with my fork, but not with the polyfill.

@rodneyrehm
Copy link
Owner

I don't understand. you still need to add the polyfill to your PR anyway?!

@henryruhs
Copy link
Contributor Author

Lost in conversation, I thought you are going to add it. Anyway - I updated my fork. The pull request can be merged.

rodneyrehm added a commit that referenced this pull request Aug 21, 2015
feature(events): adding events `viewport-unit-buggyfill-init` and `viewport-unit-buggyfill-style`
@rodneyrehm rodneyrehm merged commit 811238f into rodneyrehm:master Aug 21, 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.

2 participants