Commit f7224ac3 authored by Sohail Lajevardi's avatar Sohail Lajevardi
Browse files

Issue #3298700 by immaculatexavier, sgroundwater, doxigo: dropbutton-widget...

Issue #3298700 by immaculatexavier, sgroundwater, doxigo: dropbutton-widget save button displays as empty when an input is provided instead of a link
parent 45c0931f
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -70,6 +70,17 @@ function radix_preprocess_links__dropbutton(&$variables) {

    // Remove first link from links.
    array_shift($links);

    foreach ($links as $key => $link) {
      $links[$key]['link']['#options']['attributes']['class'][] = 'dropdown-item';
    }

  } elseif (isset($link['text'])) {
    $button = $link['text'];
    $variables['button'] = $button;

    // Remove first link from links.
    array_shift($links);
  }

  // Add required classes.
+22 −0
Original line number Diff line number Diff line
{#
/**
 * @file
 * Default theme implementation for a dropbutton wrapper.
 *
 * Available variables:
 * - children: Contains the child elements of the dropbutton menu.
 *
 * @see template_preprocess()
 *
 * @ingroup themeable
 */
#}
{% if children %}
  {% apply spaceless %}
    <div class="dropbutton-wrapper">
      <div class="dropbutton-widget">
        {{ children }}
      </div>
    </div>
  {% endapply %}
{% endif %}
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
        {{ button }}
      {% endif %}
    </button>
    <div class="dropdown-menu dropdown-menu-right">
    <ul class="dropdown-menu dropdown-menu-right">
      {%- for item in links -%}
        {%- if item.link -%}
          {{ item.link }}
@@ -28,6 +28,6 @@
          {{ item.text }}
        {%- endif -%}
      {%- endfor -%}
    </div>
    </ul>
  {% endif %}
</div>
+0 −1
Original line number Diff line number Diff line
{% include '@radix/nav/links--dropbutton.twig' %}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
{% include '@radix/form/dropbutton-wrapper.twig' %}
 No newline at end of file