Skip to content
Snippets Groups Projects

Issue #3225621: Use media query event listener instead of a listener on the resize event

Open Issue #3225621: Use media query event listener instead of a listener on the resize event
3 unresolved threads
Open Marcus Souza requested to merge issue/drupal-3225621:3225621-use-media-query into 9.4.x
3 unresolved threads

Closes #3225621

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
39 39 }
40 40 };
41 41
42 const toggleCollapsed = () => {
43 if (window.matchMedia('(min-width: 48em)').matches) {
42 const toggleCollapsed = (matches) => {
  • 60 60 }
    61 61 };
    62 62
    63 const handleToggleMQ = (event) => {
  • 68 72 });
    69 73
    70 74 $tab.on('click.tabs', '[data-drupal-nav-tabs-trigger]', openMenu);
    71 $(window)
    72 // @todo use a media query event listener https://www.drupal.org/project/drupal/issues/3225621
    73 .on('resize.tabs', Drupal.debounce(toggleCollapsed, 150))
    74 .trigger('resize.tabs');
    75
    76 const mql = window.matchMedia('(min-width: 48em)');
    77 mql.addListener(handleToggleMQ);
    78 toggleCollapsed(mql.matches);
  • Konstantin Shupenko added 174 commits

    added 174 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Marcus Souza changed target branch from 9.3.x to 9.4.x

    changed target branch from 9.3.x to 9.4.x

  • Please register or sign in to reply
    Loading