Sha256: 62ede483752ef0cefede51fbaebff2e90dbd4bc75e2ffe9432e0ad7e7241f750

Contents?: true

Size: 801 Bytes

Versions: 46

Compression:

Stored size: 801 Bytes

Contents

export const showElement = (elem: any) => {
    elem.style.display = 'block';
    const height = elem.scrollHeight + 'px'; // Get its height
    elem.style.height = height; // Update the max-height
    elem.classList.add('is-visible')
    // Once the transition is complete, remove the inline max-height so the content can scale responsively
    window.setTimeout(() => {
      elem.style.height = '';
    }, 300);
  };

  export const hideElement = (elem:any) => {
    elem.style.height = elem.scrollHeight + 'px';

    window.setTimeout(() => {
      elem.style.height = '0';
      elem.style.paddingTop = '0';
      elem.style.paddingBottom = '0';
    }, 1);

    // When the transition is complete, hide it
    window.setTimeout(() => {
      elem.classList.remove('is-visible');
    }, 300);
  };

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
playbook_ui-12.36.0.pre.alpha.svgiconmethods1043 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.36.0.pre.alpha.PLAY942collapsiblenav21035 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.36.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.35.0.pre.alpha.iconpocwebfonts1023 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.35.0 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts
playbook_ui-12.33.1.pre.alpha.PLAY933navkitcollapsible994 app/pb_kits/playbook/pb_collapsible/_helper_functions.ts