|
@ -2,27 +2,22 @@ |
|
|
$(document).ready( () => { |
|
|
$(document).ready( () => { |
|
|
console.log('Load component - header') |
|
|
console.log('Load component - header') |
|
|
|
|
|
|
|
|
const components = $('.component-header') |
|
|
|
|
|
|
|
|
const component = $('.component-header') |
|
|
|
|
|
|
|
|
components.each( (i, e) => { |
|
|
|
|
|
const component = $(e) |
|
|
|
|
|
const hamburger = component.find('.hamburger') |
|
|
const hamburger = component.find('.hamburger') |
|
|
const menu = component.find('.sidebar-menu') |
|
|
const menu = component.find('.sidebar-menu') |
|
|
|
|
|
|
|
|
hamburger.on('click', (e) => { |
|
|
|
|
|
const hamburger = $(e.currentTarget) |
|
|
|
|
|
hamburger.toggleClass('is-active') |
|
|
|
|
|
|
|
|
hamburger.off('.click').on('click.click', (e) => { |
|
|
|
|
|
const ham = $(e.currentTarget) |
|
|
|
|
|
|
|
|
if(hamburger.hasClass('is-active')){ |
|
|
|
|
|
|
|
|
ham.toggleClass('is-active') |
|
|
|
|
|
console.log(ham, menu) |
|
|
|
|
|
|
|
|
|
|
|
if(ham.hasClass('is-active')){ |
|
|
menu.addClass('active') |
|
|
menu.addClass('active') |
|
|
//items.slideDown()
|
|
|
|
|
|
//$('html, body').css({overflow: 'hidden'})
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
menu.removeClass('active') |
|
|
menu.removeClass('active') |
|
|
//items.slideUp()
|
|
|
|
|
|
//$('html, body').css({overflow: 'auto'})
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|