Commit 5cabcecc authored by baldwinlouie's avatar baldwinlouie Committed by Yas Naoi
Browse files

Issue #3294577 by baldwinlouie, yas: Remove dropdown caret in entity...

Issue #3294577 by baldwinlouie, yas: Remove dropdown caret in entity operations if there is only one operation
parent ae0e250a
Loading
Loading
Loading
Loading
+27 −17
Original line number Diff line number Diff line
@@ -16,6 +16,14 @@

  $(document).on('click', '.custom-dropdown > button', function (event) {
    event.stopPropagation();

    // If there is no caret class, and the button is clicked,
    // redirect the user to the child link.
    if (!$(this).find('span').hasClass('caret')) {
      if ($(this).find('a').length > 0) {
        window.location.href = $(this).find('a').attr('href');
      }
    }
    $('.custom-dropdown .dropdown-menu').hide();
    if ($(this).hasClass('open')) {
      $(this).next().hide();
@@ -35,7 +43,9 @@

  $(document).click(function (e) {
    var target = e.target;
    if (!$(target).is('.custom-dropdown > button') && !$(target).parents().is('.custom-dropdown > button')) { $('.custom-dropdown .dropdown-menu').hide(); }
    if (!$(target).is('.custom-dropdown > button') && !$(target).parents().is('.custom-dropdown > button')) {
      $('.custom-dropdown .dropdown-menu').hide();
    }
  });

})(jQuery);
+43 −41
Original line number Diff line number Diff line
@@ -59,9 +59,11 @@
          <button class="dropdown-toggle links" type="button">
            <span {{ item.attributes.addClass(key|clean_class) }}></span>

          <span{{ item.text_attributes }}></span>
{#            <span{{ item.text_attributes }}></span>#}
            {{ item.link|without(item.link.0) }}
          {% if links|length > 1 %}
            <span class="caret"></span>
            {% endif %}
          </button>

        {%- elseif item.text_attributes -%}