Commit 45a4dbf3 authored by Mathilde Dumond's avatar Mathilde Dumond Committed by Sascha Grossenbacher
Browse files

Issue #3199551 by romina_ferrario, JeroenT, mathilde_dumond, nuez, mrinalini9:...

Issue #3199551 by romina_ferrario, JeroenT, mathilde_dumond, nuez, mrinalini9: The content/behavior tabs on the paragraphs widget don't render properly in Claro
parent 430fb27c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@
  }
}

.paragraphs-tabs-wrapper .paragraphs-tabs {
.paragraphs-tabs-wrapper .paragraphs-tabs-hide {
  display: none;
}

+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@


.paragraphs-tabs-wrapper {
  .paragraphs-tabs {
  .paragraphs-tabs-hide {
    display: none;
  }
}
+7 −2
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@
    if ($tabBehavior.hasClass('is-active')) {
      $parWidget.removeClass('content-active').addClass('behavior-active');
      $tabContent.removeClass('is-active');
      $tabContent.find('a').removeClass('is-active');
      $tabBehavior.addClass('is-active');
      $tabBehavior.find('a').addClass('is-active');
    }
    else {
      // Activate content tab visually if there is no previously
@@ -31,12 +33,13 @@
      if (!($mainRegion.hasClass('content-active'))
        && !($mainRegion.hasClass('behavior-active'))) {
        $tabContent.addClass('is-active');
        $tabContent.find('a').addClass('is-active');
        $parWidget.addClass('content-active');
      }

      $parTabs.show();
      $parTabs.removeClass('paragraphs-tabs-hide');
      if ($parBehavior.length === 0) {
        $parTabs.hide();
        $parTabs.addClass('paragraphs-tabs-hide');
      }
    }
  };
@@ -54,7 +57,9 @@
    var $clickedTabParent = $clickedTab.parent();

    $parTabs.find('li').removeClass('is-active');
    $parTabs.find('li').find('a').removeClass('is-active');
    $clickedTabParent.addClass('is-active');
    $clickedTabParent.find('a').addClass('is-active');

    $parWidget.removeClass('behavior-active content-active');
    if ($clickedTabParent.hasClass('paragraphs_content_tab')) {
+1 −1
Original line number Diff line number Diff line
@@ -1061,7 +1061,7 @@ class ParagraphsWidget extends WidgetBase {
    $field_prefix = strtr($this->fieldIdPrefix, '_', '-');
    if (count($this->fieldParents) == 0) {
      if ($items->getEntity()->getEntityTypeId() != 'paragraph') {
        $tabs = '<ul class="paragraphs-tabs tabs primary clearfix"><li class="tabs__tab paragraphs_content_tab"><a href="#' . $field_prefix . '-values">' . $this->t('Content', [], ['context' => 'paragraphs']) . '</a></li><li class="tabs__tab paragraphs_behavior_tab"><a href="#' . $field_prefix . '-values">' . $this->t('Behavior', [], ['context' => 'paragraphs']) . '</a></li></ul>';
        $tabs = '<ul class="paragraphs-tabs tabs primary tabs--secondary paragraphs-tabs-hide clearfix"><li class="tabs__tab paragraphs_content_tab"><a href="#' . $field_prefix . '-values" class="tabs__link">' . $this->t('Content', [], ['context' => 'paragraphs']) . '</a></li><li class="tabs__tab paragraphs_behavior_tab"><a href="#' . $field_prefix . '-values" class="tabs__link">' . $this->t('Behavior', [], ['context' => 'paragraphs']) . '</a></li></ul>';
      }
    }
    if (count($this->fieldParents) > 0) {