Loading config/install/tocify.settings.yml +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' Loading src/Plugin/Block/TableOfContents.php +4 −4 Original line number Diff line number Diff line Loading @@ -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', Loading Loading @@ -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'); Loading Loading @@ -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'], Loading Loading
config/install/tocify.settings.yml +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' Loading
src/Plugin/Block/TableOfContents.php +4 −4 Original line number Diff line number Diff line Loading @@ -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', Loading Loading @@ -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'); Loading Loading @@ -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'], Loading