diff --git a/core/modules/views_ui/css/views_ui.admin.theme.css b/core/modules/views_ui/css/views_ui.admin.theme.css index b5f2a03..a228e34 100644 --- a/core/modules/views_ui/css/views_ui.admin.theme.css +++ b/core/modules/views_ui/css/views_ui.admin.theme.css @@ -824,7 +824,6 @@ td.group-title { */ .views-filterable-options .form-type-checkbox { - border: 1px solid #ccc; padding: 5px 8px; border-top: none; } @@ -833,10 +832,6 @@ td.group-title { border-top: 1px solid #ccc; } -.views-filterable-options .filterable-option:nth-of-type(even) .form-type-checkbox { - background-color: #f3f4ee; -} - .filterable-option .form-item { margin-bottom: 0; margin-top: 0; diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 5310062..5fd7c39 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -191,7 +191,7 @@ Drupal.viewsUi.AddItemForm.prototype.handleCheck = function (event) { var $target = $(event.target); - var label = $.trim($target.next().text()); + var label = $.trim($target.closest('td').next().text()); // Add/remove the checked item to the list. if ($target.is(':checked')) { this.$selected_div.show().css('display', 'block'); @@ -341,7 +341,7 @@ for (i = 0; i < length; i++) { $option = $($allOptions[i]); $label = $option.find('label'); - $description = $option.find('div.description'); + $description = $option.find('td.description'); options[i] = { // Search on the lowercase version of the label text + description. 'searchText': $label.text().toLowerCase() + " " + $description.text().toLowerCase(), diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index 8cc2e8c..ba80924 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -107,8 +107,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['options']['name'] = array( '#prefix' => '
', '#suffix' => '
', + '#type' => 'table', + '#header' => array( + $this->t('Title'), + $this->t('Category'), + $this->t('Description'), + ), + '#tableselect' => TRUE, '#tree' => TRUE, - '#default_value' => 'all', ); // Group options first to simplify the usage of #states. @@ -138,12 +144,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { foreach ($grouped_options as $group => $group_options) { foreach ($group_options as $key => $option) { $form['options']['name'][$key] = array( - '#type' => 'checkbox', - '#title' => $this->t('!group: !field', array('!group' => $option['group'], '!field' => $option['title'])), - '#description' => $option['help'], - '#return_value' => $key, - '#prefix' => "
", - '#suffix' => '
', + '#tree' => TRUE, '#states' => array( 'visible' => array( array( @@ -152,8 +153,23 @@ public function buildForm(array $form, FormStateInterface $form_state) { array( ':input[name="override[controls][group]"]' => array('value' => $group), ), - ) - ) + ), + ), + '#attributes' => array( + 'class' => array('filterable-option'), + ), + 'title' => array( + '#markup' => $option['title'], + ), + 'group' => array( + '#markup' => $option['group'], + ), + 'help' => array( + '#markup' => $option['help'], + '#wrapper_attributes' => array( + 'class' => array('description'), + ), + ), ); } }