Commit 0b7aabe7 authored by Geoff Thompson's avatar Geoff Thompson Committed by Damien McKenna
Browse files

Issue #3268439 by chakkche, bygeoffthompson, DamienMcKenna, Ruturaj Chaubey:...

Issue #3268439 by chakkche, bygeoffthompson, DamienMcKenna, Ruturaj Chaubey: Optional overflow control on expanded Metatag field widget.
parent fc3a5774
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ Metatag 8.x-1.x-dev, 2022-xx-xx
#3112509 by DamienMcKenna: Fix regression in Google+ tests.
#2563655 by DamienMcKenna, waldomero: Absorb Metatag Routes module to allow
  per-path/route configurations.
#3268439 by chakkche, bygeoffthompson, DamienMcKenna, Ruturaj Chaubey: Optional
  overflow control on expanded Metatag field widget.


Metatag 8.x-1.19, 2022-01-06
+3 −0
Original line number Diff line number Diff line
@@ -23,3 +23,6 @@ metatag.settings:
      sequence:
        type: integer
        label: 'Tag maximum length in characters'
    tag_scroll_max_height:
      type: string
      label: 'Add max height value'
+9 −0
Original line number Diff line number Diff line
/**
 * @file
 * Custom CSS for the Firehose widget.
 */

.metatags {
  max-height: 500px;
  overflow-y: overlay;
}

metatag.libraries.yml

0 → 100644
+6 −0
Original line number Diff line number Diff line
# Custom libraries for the Metatag module.

firehose_widget:
  css:
    theme:
      css/firehose_widget.css: {}
+22 −0
Original line number Diff line number Diff line
@@ -153,6 +153,24 @@ class MetatagSettingsForm extends ConfigFormBase {
        'beforeValue' => $this->t('Trim the Meta Tag before the word on the given value'),
      ],
    ];

    $scrollheight = $this->config('metatag.settings')->get('tag_scroll_max_height');

    $form['firehose_widget'] = [
      '#title' => $this->t('Metatag widget options'),
      '#type' => 'details',
      '#tree' => TRUE,
      '#open' => TRUE,
      '#description' => $this->t("Various options for the field widget used on entity forms, e.g. on content type forms."),
    ];

    $form['firehose_widget']['tag_scroll_max_height'] = [
      '#title' => $this->t('Scroll maximum height'),
      '#type' => 'textfield',
      '#default_value' => $scrollheight,
      '#placeholder' => $this->t('eg 500px or 8rem'),
      '#description' => $this->t("To enable scrolling please enter a value and its units, e.g. 500px, 8rem, etc. Removing this value will remove the scroll."),
    ];
    return parent::buildForm($form, $form_state);
  }

@@ -178,6 +196,10 @@ class MetatagSettingsForm extends ConfigFormBase {
    $trimmingValues = $form_state->getValue(['tag_trim', 'maxlength']);
    $settings->set('tag_trim_maxlength', $trimmingValues);

    // Widget settings.
    $scrollheightvalue = $form_state->getValue(['firehose_widget', 'tag_scroll_max_height']);
    $settings->set('tag_scroll_max_height', $scrollheightvalue);

    $settings->save();
    parent::submitForm($form, $form_state);
  }
Loading