Unverified Commit 8f3e4b80 authored by Alexey's avatar Alexey Committed by Stefan Auditor
Browse files

Issue #3225108 by aleevas: Not abble to add tocify block in Layout Builder

parent 1a880f08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
theme: 'none'
context: '.node__content .text-formatted'
container: '.node__content .text-formatted'
selectors: 'h2,h3,h4,h5,h6'
show_and_hide: true
show_effect: 'slideDown'
+4 −4
Original line number Diff line number Diff line
@@ -80,11 +80,11 @@ class TableOfContents extends BlockBase implements ContainerFactoryPluginInterfa
      '#size' => 64,
      '#weight' => '0',
    ];
    $form['context'] = [
    $form['container'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Context'),
      '#description' => $this->t('Choose any valid jQuery selector, e.g. "body"'),
      '#default_value' => isset($this->configuration['context']) ? $this->configuration['context'] : $defaults->get('context'),
      '#default_value' => isset($this->configuration['container']) ? $this->configuration['container'] : $defaults->get('container'),
      '#maxlength' => 64,
      '#size' => 64,
      '#weight' => '0',
@@ -252,7 +252,7 @@ class TableOfContents extends BlockBase implements ContainerFactoryPluginInterfa
   */
  public function blockSubmit($form, FormStateInterface $form_state) {
    $this->configuration['theme'] = $form_state->getValue('theme');
    $this->configuration['context'] = $form_state->getValue('context');
    $this->configuration['container'] = $form_state->getValue('container');
    $this->configuration['selectors'] = $form_state->getValue('selectors');
    $this->configuration['show_and_hide'] = $form_state->getValue('show_and_hide');
    $this->configuration['show_effect'] = $form_state->getValue('show_effect');
@@ -283,7 +283,7 @@ class TableOfContents extends BlockBase implements ContainerFactoryPluginInterfa
      '#attached' => ['library' => ['tocify/tocify']],
      '#attributes' => [
        'class' => ['table-of-contents'],
        'data-context' => $this->configuration['context'],
        'data-context' => $this->configuration['container'],
        'data-theme' => $this->configuration['theme'],
        'data-selectors' => $this->configuration['selectors'],
        'data-show-and-hide' => $this->configuration['show_and_hide'],