Skip to content

Commit

Permalink
Implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed Nov 17, 2024
1 parent c25234d commit ab1735a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions modules/tide_landing_page/js/hero_image_theme.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function (Drupal) {
"use strict";
'use strict';

Drupal.behaviors.heroImageTheme = {
attach: function (context, settings) {
attach: function (context) {
const imageTheme = context.querySelector(
'select[data-drupal-selector^="edit-field-landing-page-hero-theme"]'
);
Expand All @@ -16,13 +16,13 @@

if (headerStyles.length > 0) {
headerStyles.forEach((style) => {
style.addEventListener("change", setImageTheme);
style.addEventListener('change', setImageTheme);
});
}
}

function setImageTheme() {
const selectedHeaderStyle = document.querySelector(
const selectedHeaderStyle = context.querySelector(
'input[data-drupal-selector^="edit-header-style-options"]:checked'
);

Expand All @@ -31,10 +31,9 @@
}

let defaultHeaderStyle = selectedHeaderStyle.value;
imageTheme.disabled =
defaultHeaderStyle === "corner" ? false : true;
imageTheme.disabled = defaultHeaderStyle === 'corner' ? false : true;
imageTheme.value =
defaultHeaderStyle === "fullwidth" ? "dark" : "light";
defaultHeaderStyle === 'fullwidth' ? 'dark' : 'light';
}
},
};
Expand Down

0 comments on commit ab1735a

Please sign in to comment.