-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
https://github.com/CU-CommunityApps/cwd_project/blob/main/js/project.js
Let's change how project.js is initialized -- follow-up to discussion on Slack.
Specifically:
- Use Drupal 8/9 best practices
- Er, well now it's Drupal 10!...
- (Probably?) Include
'use strict';with whatever we come up with.
To do
- Decide how to init
project.js - Update
project.js - Update cwd_project on CD Demo (manually)
- (Optionally) Publish cwd_project release with this change
Background
Drupal reference
Best practices laid out in Drupal JavaScript API documentation
What's in project.js now
(https://github.com/CU-CommunityApps/cwd_project/blob/main/js/project.js)
jQuery(document).ready(function($) {
// By default, site search uses this site.
$('input[type=radio][name=sitesearch]').on('change', function() {
switch ($(this).val()) {
// ...etc etc etc...
}
});
});What's in some of our D8 sites' child theme JS files
(probably based on the old cwd_ssit theme?? -- but I haven't confirmed this speculation)
(function ($, Drupal) {
'use strict';
// By default, site search uses this site.
$('input[type=radio][name=sitesearch]').on('change', function() {
switch ($(this).val()) {
// ...etc etc etc...
}
});
})(jQuery, this);Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request