Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed Nov 21, 2024
1 parent 4d1de87 commit 294b0c6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions modules/tide_landing_page/tide_landing_page.module
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

use Drupal\Core\Cache\Cache;
use \Drupal\Core\Ajax\AjaxResponse;
use \Drupal\Core\Ajax\InvokeCommand;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
Expand Down Expand Up @@ -44,7 +46,7 @@ function tide_landing_page_entity_bundle_create($entity_type_id, $bundle) {
$editorial_workflow = Workflow::load('editorial');
if ($editorial_workflow) {
$editorial_workflow->getTypePlugin()
->addEntityTypeAndBundle('node', 'landing_page');
->addEntityTypeAndBundle('node', 'landing_page');
$editorial_workflow->save();
}
}
Expand Down Expand Up @@ -373,17 +375,17 @@ function tide_landing_page_field_widget_single_element_paragraphs_form_alter(&$e
}
}

function change_the_value($form, FormStateInterface $form_state): \Drupal\Core\Ajax\AjaxResponse {
$response = new \Drupal\Core\Ajax\AjaxResponse();
function tide_landing_page_change_the_value($form, FormStateInterface $form_state): \Drupal\Core\Ajax\AjaxResponse {
$response = new AjaxResponse();
$value = $form_state->getValue('_header_style_options');
if ($value === 'fullwidth'){
return $response->addCommand(new \Drupal\Core\Ajax\InvokeCommand(
if ($value === 'fullwidth') {
return $response->addCommand(new InvokeCommand(
'#edit-field-landing-page-hero-theme',
'val',
['dark']
));
}
return $response->addCommand(new \Drupal\Core\Ajax\InvokeCommand(
return $response->addCommand(new InvokeCommand(
'#edit-field-landing-page-hero-theme',
'val',
['light']
Expand Down Expand Up @@ -425,7 +427,7 @@ function _tide_landing_page_form_node_form_process(array $form, FormStateInterfa
'cta' => t('Call to action banner'),
],
'#ajax' => [
'callback' => 'change_the_value',
'callback' => 'tide_landing_page_change_the_value',
],
];
$form['field_landing_page_hero_image']['widget']['field_landing_page_hero_theme']['#states']['disabled'] = [
Expand Down

0 comments on commit 294b0c6

Please sign in to comment.