Skip to content

Conversation

wvdweij
Copy link

@wvdweij wvdweij commented Feb 10, 2015

No description provided.

}, false);
/* check for older browsers */
if (!window.addEventListener) {
this.attachEvent("readystatechange", function () {
Copy link
Member

Choose a reason for hiding this comment

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

It's onreadystatechange if I'm not wrong?
I'd also deduplicate the closure by putting it in a variable

Copy link
Author

Choose a reason for hiding this comment

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

Thx for feedback, will fix it!

Copy link
Contributor

Choose a reason for hiding this comment

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

It can be nice to add a comment like that to help people to handerstand this part of code.

// Fix ie8&9, does not have XMLHttpRequest.addEventListener method.
// @see https://developer.mozilla.org/fr/docs/Web/API/Element.addEventListener#Internet_Explorer

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
};

/* check for older browsers */
if (!window.addEventListener) {
Copy link
Member

Choose a reason for hiding this comment

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

you should use this.addEventListener here as this is what you use just after

Copy link
Author

Choose a reason for hiding this comment

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

Thx for feedback, changed it

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |
@WedgeSama
Copy link
Contributor

There is also 2 addEventListener calls in Collection:form.html.twig at lines 284 & 383.

@fabpot
Copy link
Member

fabpot commented Feb 10, 2015

Closing in favor of #13636

@fabpot fabpot closed this Feb 10, 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.

5 participants