Note - a follow up pull request has been created https://github.com/accessdigital/wilson/pull/16, which add linting to the theme JS. Therefore, some of the more opinionated changes in this file (e.g. arrow function parentheses) can be ignored as https://github.com/accessdigital/wilson/pull/16 includes changes that bring code standards inline with those suggested in Drupal core
Background / Motivation
ES6 was being used in some theme JS files but not others (Babel is already in place to support ES6)
Added Drupal.t() function for translatable strings
Created Glide library (referenced as a dependency in Slider and Gallery libraries). Previously the Glide CSS and JS could potentially be output twice, if both a Slider and Gallery are output onto the same page
Next steps
Introduce JS linting to the project to help further improve consistency and help standardise approach on current and future code
Note - a follow up pull request has been created https://github.com/accessdigital/wilson/pull/16, which add linting to the theme JS. Therefore, some of the more opinionated changes in this file (e.g. arrow function parentheses) can be ignored as https://github.com/accessdigital/wilson/pull/16 includes changes that bring code standards inline with those suggested in Drupal core
Background / Motivation
Approach
Additional work
Drupal.t()
function for translatable stringsNext steps