update
This commit is contained in:
@@ -102,3 +102,7 @@ background-color: #ffff0080 !important;
|
||||
margin-left:0.7rem; margin-right:0.7rem; margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
margin:-2px;
|
||||
}
|
||||
|
||||
@@ -97,52 +97,3 @@ function m_tab_content(name, content, active) {
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
/////// Prevent closing from click inside dropdown
|
||||
document.querySelectorAll('.dropdown-menu').forEach(function(element){
|
||||
element.addEventListener('click', function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
})
|
||||
|
||||
// make it as accordion for smaller screens
|
||||
if (window.innerWidth < 992) {
|
||||
|
||||
// close all inner dropdowns when parent is closed
|
||||
document.querySelectorAll('.navbar .dropdown').forEach(function(everydropdown){
|
||||
everydropdown.addEventListener('hidden.bs.dropdown', function () {
|
||||
// after dropdown is hidden, then find all submenus
|
||||
this.querySelectorAll('.submenu').forEach(function(everysubmenu){
|
||||
// hide every submenu as well
|
||||
everysubmenu.style.display = 'none';
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
document.querySelectorAll('.dropdown-menu a').forEach(function(element){
|
||||
element.addEventListener('click', function (e) {
|
||||
|
||||
let nextEl = this.nextElementSibling;
|
||||
if(nextEl && nextEl.classList.contains('submenu')) {
|
||||
// prevent opening link if link needs to open dropdown
|
||||
e.preventDefault();
|
||||
console.log(nextEl);
|
||||
if(nextEl.style.display == 'block'){
|
||||
nextEl.style.display = 'none';
|
||||
} else {
|
||||
nextEl.style.display = 'block';
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
// end if innerWidth
|
||||
|
||||
});
|
||||
// DOMContentLoaded end
|
||||
@@ -1 +1 @@
|
||||
VERSION="4.0.44"
|
||||
VERSION="4.0.45"
|
||||
Reference in New Issue
Block a user