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

Use the Event constructor in browsers that support it. Fixes #4188. #4191

Merged
merged 2 commits into from
Mar 10, 2016

Conversation

sgomes
Copy link
Contributor

@sgomes sgomes commented Mar 10, 2016

For old IE, it falls back to createEvent + initEvent, the latter of
which is deprecated and may be missing from some browsers.

@surma @Garbee PTAL!

For old IE, it falls back to createEvent + initEvent, the latter of
which is deprecated and may be missing from some browsers.
@Garbee
Copy link
Collaborator

Garbee commented Mar 10, 2016

Downgrade is also needed.

@sgomes
Copy link
Contributor Author

sgomes commented Mar 10, 2016

Good catch, thanks! Will amend.

@sgomes
Copy link
Contributor Author

sgomes commented Mar 10, 2016

Sorted, downgrade is now fixed too.

As an aside, Drone is acting up, so the build may fail. @crhym3 is on it.

@Garbee
Copy link
Collaborator

Garbee commented Mar 10, 2016

LGTM, our only other uses of initEvent are internal to tests. So they don't need to be upgraded right away.

@sgomes
Copy link
Contributor Author

sgomes commented Mar 10, 2016

Thanks, @Garbee!

sgomes added a commit that referenced this pull request Mar 10, 2016
Use the Event constructor in browsers that support it. Fixes #4188.
@sgomes sgomes merged commit 8a698ab into mdl-1.1 Mar 10, 2016
@sgomes sgomes deleted the init-event-deprecated branch March 10, 2016 17:56
@@ -351,9 +358,15 @@ componentHandler = (function() {
upgrades.splice(componentPlace, 1);
component.element_.setAttribute('data-upgraded', upgrades.join(','));

var ev = document.createEvent('Events');
ev.initEvent('mdl-componentdowngraded', true, true);
component.element_.dispatchEvent(ev);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you removed the dispatchEvent...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I did remove it on the downgrade event! Thanks for the keen eye, @tleunen!

sgomes pushed a commit that referenced this pull request Mar 21, 2016
andreasonny83 added a commit to andreasonny83/material-design-lite that referenced this pull request May 13, 2016
* master:
  fixing mocha errors
  fixing eslint related errors and warnings
  eslint error fixes
  Remove automatic name/value example. Functionality was removed before publishing.
  Update button note to reflect disabled classes purpose.
  Fix downgrade event firing (bug introduced in google#4191)
  Small tweak to make Closure compiler happy
  Bump to 1.1.3
  Fix grammatical error
  Fix snackbar position on mobile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants