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.96.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.96.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.95.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.37.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.37.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.36.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.5 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.4 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.3 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.2 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.35.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.94.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.34.2 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.34.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.34.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.94.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.33.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.32.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.93.0 assets/js/src/addClassToOpenNavbar.js