| 1 |
const wp_bottom_menu_class = document.querySelector('.wp-bottom-menu'); |
| 2 |
const wp_bottom_menu_sfw = document.querySelector('.wp-bottom-menu-search-form-wrapper'); |
| 3 |
const wp_bottom_menu_sft = document.querySelector(".wp-bottom-menu-search-form-trigger"); |
| 4 |
var wpbmsf = false; |
| 5 |
|
| 6 |
if ( wp_bottom_menu_sft !== null ){ |
| 7 |
wp_bottom_menu_sft.addEventListener("click" ,function(){ |
| 8 |
wp_bottom_menu_sfw.classList.toggle("sf-active"); |
| 9 |
wp_bottom_menu_class.classList.toggle("sf-active"); |
| 10 |
if (!wpbmsf){ |
| 11 |
wp_bottom_menu_sfw.style.bottom = wp_bottom_menu_class.clientHeight + "px"; |
| 12 |
wpbmsf = true; |
| 13 |
} else { |
| 14 |
wp_bottom_menu_sfw.style.bottom = "0px"; |
| 15 |
wpbmsf = false; |
| 16 |
} |
| 17 |
}); |
| 18 |
} |
| 19 |
|
| 20 |
window.addEventListener('DOMContentLoaded', (event) => { |
| 21 |
document.body.style.paddingBottom = wp_bottom_menu_class.clientHeight + "px"; |
| 22 |
}); |
| 23 |
|
| 24 |
// Nav trigger |
| 25 |
const wp_bottom_menu_nav_wrapper = document.querySelector(".wp-bottom-menu-nav-wrapper"); |
| 26 |
const wp_bottom_menu_nav_trigger = document.querySelector(".wp-bottom-menu-nav-trigger"); |
| 27 |
const wp_bottom_menu_nav_close = document.querySelector(".wpbm-nav-close"); |
| 28 |
var wpbm_nav = false; |
| 29 |
|
| 30 |
if ( wp_bottom_menu_nav_trigger !== null ){ |
| 31 |
wp_bottom_menu_nav_trigger.addEventListener("click" ,function(){ |
| 32 |
wp_bottom_menu_nav_wrapper.classList.toggle("active"); |
| 33 |
}); |
| 34 |
} |
| 35 |
|
| 36 |
if ( wp_bottom_menu_nav_close !== null ){ |
| 37 |
wp_bottom_menu_nav_close.addEventListener("click" ,function(){ |
| 38 |
wp_bottom_menu_nav_wrapper.classList.toggle("active"); |
| 39 |
}); |
| 40 |
} |