Sha256: d846c1dd1c18c09d5f3978b233a2fa4f8003ba91462a32edbaf0b06257c6532c

Contents?: true

Size: 565 Bytes

Versions: 169

Compression:

Stored size: 565 Bytes

Contents

const NAVBAR_COLLAPSE_ID = 'headerGlobalNavbarContent';
const HEADER_GLOBAL = '.header-global';

function addClassToOpenNavbar() {
  if ( ! document.getElementById(NAVBAR_COLLAPSE_ID) )
    return;

  const collapse = document.getElementById(NAVBAR_COLLAPSE_ID);
  const header = document.querySelector(HEADER_GLOBAL);

  $(collapse).on('show.bs.collapse', (e) => {
    header.classList.add('header-global__open');
  });

  $(collapse).on('hide.bs.collapse', (e) => {
    header.classList.remove('header-global__open');
  });
}

export default addClassToOpenNavbar;

Version data entries

169 entries across 169 versions & 3 rubygems

Version Path
kcc-gem-theme-1.67.68 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.68 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.67 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.66 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.65 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.64 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.63 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.66.62 assets/js/theme/src/addClassToOpenNavbar.js
kcc-gem-theme-1.65.62 assets/js/theme/src/addClassToOpenNavbar.js