diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index c443e85..04c073a 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -448,10 +448,10 @@ * Add a keyup handler to the search box. */ this.$searchBox = this.$form.find('[data-drupal-selector="edit-override-controls-options-search"]'); - this.$searchBox.on('keyup', $.proxy(this.handlefilter, this)); + this.$searchBox.on('keyup', $.proxy(this.handleFilter, this)); this.$filterType = this.$form.find('[data-drupal-selector="edit-override-controls-group"]'); - this.$filterType.on('change', $.proxy(this.handlefilter, this)); + this.$filterType.on('change', $.proxy(this.handleFilter, this)); /** * Get a list of option labels and their corresponding divs and maintain it @@ -460,7 +460,7 @@ this.options = this.getOptions(this.$form.find('.filterable-option')); // Restripe on initial loading. - this.handlefilter(); + this.handleFilter(); // Trap the ENTER key in the search box so that it doesn't submit the form. this.$searchBox.on('keypress', function (event) { if (event.which === 13) { @@ -511,7 +511,7 @@ * @param {jQuery.Event} event * The keyup event or change event. */ - handlefilter: function (event) { + handleFilter: function (event) { var found; var option; var zebraClass; diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index d07f040..97f60f5 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -107,15 +107,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['options']['name'] = array( '#prefix' => '
', '#suffix' => '
', - '#type' => 'table', + '#type' => 'tableselect', '#header' => array( - $this->t('Title'), - $this->t('Category'), - $this->t('Description'), + 'title' => $this->t('Title'), + 'group' => $this->t('Category'), + 'help' => $this->t('Description'), ), - '#tableselect' => TRUE, '#js_select' => FALSE, - '#tree' => TRUE, ); $grouped_options = array(); @@ -143,26 +141,19 @@ 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( - '#tree' => TRUE, + $form['options']['name']['#options'][$key] = array( '#attributes' => array( 'class' => array('filterable-option', $group), ), 'title' => array( - '#markup' => $option['title'], - '#wrapper_attributes' => array( - 'class' => array('title'), - ), - ), - 'group' => array( - '#markup' => $option['group'], - ), - 'help' => array( - '#markup' => $option['help'], - '#wrapper_attributes' => array( - 'class' => array('description'), + 'data' => array( + '#title' => $option['title'], + '#plain_text' => $option['title'], ), + 'class' => array('title'), ), + 'group' => $option['group'], + 'help' => $option['help'], ); } }