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-2.24.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.23.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.22.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.21.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.20.3 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.20.2 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.86.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-1.86.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.20.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.20.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.8 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.7 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.6 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.5 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.4 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.3 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.2 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.1 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.19.0 assets/js/src/addClassToOpenNavbar.js
kcc-gem-theme-2.18.0 assets/js/src/addClassToOpenNavbar.js