diff --git a/css/jsonapi_extras.expandable_rows_table.css b/css/jsonapi_extras.expandable_rows_table.css index fb2c0db..4f81413 100644 --- a/css/jsonapi_extras.expandable_rows_table.css +++ b/css/jsonapi_extras.expandable_rows_table.css @@ -1,10 +1,6 @@ .advanced-opts { display: none; - background-color: #f5f5f5; -} - -.advanced-opts td:nth-child(1) { - font-size: 2em; + background-color: rgba(0, 0, 0, 0.05); } .advanced-opts td:nth-child(2) { @@ -16,10 +12,18 @@ display: inline-block; } +.toggle-expanded { + cursor: pointer; +} + .toggle-expanded span:hover { text-decoration: none; } +.toggle-expanded span::before { + margin-right: 0.3em; +} + .toggle-expanded.content-collapsed span::before { content: "▸"; } diff --git a/js/jsonapi_extras.expandable_rows_table.js b/js/jsonapi_extras.expandable_rows_table.js index 905954c..41518a0 100644 --- a/js/jsonapi_extras.expandable_rows_table.js +++ b/js/jsonapi_extras.expandable_rows_table.js @@ -5,7 +5,7 @@ (function ($, Drupal) { - 'use strict' + 'use strict'; /** * Handles the events to collapse/expand rows. @@ -29,4 +29,4 @@ } } -}(jQuery, Drupal)) +}(jQuery, Drupal)); diff --git a/src/Form/JsonapiResourceConfigForm.php b/src/Form/JsonapiResourceConfigForm.php index 1bdd740..c02fdca 100644 --- a/src/Form/JsonapiResourceConfigForm.php +++ b/src/Form/JsonapiResourceConfigForm.php @@ -393,8 +393,11 @@ class JsonapiResourceConfigForm extends EntityForm { ], ], ]; + $overrides_form['advancedOptions'] = [ + '#markup' => t('Advanced'), + ]; - $overrides_form['advanced_options_icon'] = [ + $overrides_form['advancedOptionsIcon'] = [ '#type' => 'item', // Here we are just printing an arrow. '#markup' => '↳' @@ -402,7 +405,7 @@ class JsonapiResourceConfigForm extends EntityForm { $overrides_form['enhancer_label'] = [ '#type' => 'item', - '#markup' => 'Enhancer for: '.$field_name + '#markup' => $this->t('Enhancer for: %name', ['%name' => $field_name]), ]; // Build the select field for the list of enhancers. @@ -423,7 +426,7 @@ class JsonapiResourceConfigForm extends EntityForm { $carry[$definition['id']] = $definition['label']; return $carry; }, - ['' => $this->t('- Select -')] + ['' => $this->t('- None -')] ); $id = empty($resource_field['enhancer']['id']) ? '' diff --git a/templates/expandable-rows-table.html.twig b/templates/expandable-rows-table.html.twig index 10b070c..e4452d8 100644 --- a/templates/expandable-rows-table.html.twig +++ b/templates/expandable-rows-table.html.twig @@ -86,15 +86,15 @@ %}