As of Drupal 8 all JS needs to follow our JavaScript coding standards. For this we use ESLint to check most of our standards.
Here is the summary of running ESLint on this module JS:
9 problems (9 errors, 0 warnings)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | addtoany-2682427-7.patch | 1.31 KB | gapple |
| #2 | addtoany-eslint-error-2682427-2.patch | 1.8 KB | neelanjana das |
Comments
Comment #2
neelanjana das commentedComment #3
neelanjana das commentedComment #5
micropat commentedThanks Neelanjana!
Comment #7
gappleAdding
var a2a;within the closure breaks functionality, because now it is a local undefined variable instead of the global that is created byhttps://static.addtoany.com/menu/page.js.In order to pass ESlint without errors, a2a should be specified as a global variable in a comment.
Additionally, I'm not sure why addtoany.js uses domready: behaviours already require domready.
Comment #8
micropat commentedComment #10
micropat commentedGreat catch, gapple. Ajax works again.