Skip to content
Snippets Groups Projects
Verified Commit 1dcc53dd authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent simultaneous...

Issue #3461284 by mherchel, finnsky, quietone, nod_: Prevent simultaneous open/close on simultaneous click/hover

(cherry picked from commit c1708b32)
parent f734ef11
No related branches found
No related tags found
2 merge requests!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #227395 passed
Pipeline: drupal

#227398

    ...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
    const POPOVER_OPEN_DELAY = 150; const POPOVER_OPEN_DELAY = 150;
    const POPOVER_CLOSE_DELAY = 400; const POPOVER_CLOSE_DELAY = 400;
    const POPOVER_NO_CLICK_DELAY = 500;
    ((Drupal, once) => { ((Drupal, once) => {
    Drupal.behaviors.navigationProcessPopovers = { Drupal.behaviors.navigationProcessPopovers = {
    ...@@ -42,12 +43,17 @@ const POPOVER_CLOSE_DELAY = 400; ...@@ -42,12 +43,17 @@ const POPOVER_CLOSE_DELAY = 400;
    const expandPopover = () => { const expandPopover = () => {
    popover.classList.add('toolbar-popover--expanded'); popover.classList.add('toolbar-popover--expanded');
    button.dataset.drupalNoClick = 'true';
    tooltip.removeAttribute('inert'); tooltip.removeAttribute('inert');
    setTimeout(() => {
    delete button.dataset.drupalNoClick;
    }, POPOVER_NO_CLICK_DELAY);
    }; };
    const collapsePopover = () => { const collapsePopover = () => {
    popover.classList.remove('toolbar-popover--expanded'); popover.classList.remove('toolbar-popover--expanded');
    tooltip.setAttribute('inert', true); tooltip.setAttribute('inert', true);
    delete button.dataset.drupalNoClick;
    }; };
    /** /**
    ...@@ -134,7 +140,10 @@ const POPOVER_CLOSE_DELAY = 400; ...@@ -134,7 +140,10 @@ const POPOVER_CLOSE_DELAY = 400;
    button.addEventListener('click', (e) => { button.addEventListener('click', (e) => {
    const state = const state =
    e.currentTarget.getAttribute('aria-expanded') === 'false'; e.currentTarget.getAttribute('aria-expanded') === 'false';
    toggleState(state);
    if (!e.currentTarget.dataset.drupalNoClick) {
    toggleState(state);
    }
    }); });
    // Listens events from sidebar.js. // Listens events from sidebar.js.
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment