dropbutton.es6.js 634 B

1234567891011121314151617181920212223
  1. /**
  2. * @file
  3. * Theme overrides for Claro.
  4. */
  5. (Drupal => {
  6. /**
  7. * Overrides the dropbutton toggle markup.
  8. *
  9. * We have to keep the 'dropbutton-toggle' CSS class because the dropbutton JS
  10. * operates with that one.
  11. *
  12. * @param {object} options
  13. * Options object.
  14. * @param {string} [options.title]
  15. * The button text.
  16. *
  17. * @return {string}
  18. * A string representing a DOM fragment.
  19. */
  20. Drupal.theme.dropbuttonToggle = options =>
  21. `<li class="dropbutton-toggle"><button type="button" class="dropbutton__toggle"><span class="visually-hidden">${options.title}</span></button></li>`;
  22. })(Drupal);