mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
Fix menu bar collapse on mobile (#223)
This commit is contained in:
parent
cfc36c28d2
commit
4a2d20a8f9
1 changed files with 4 additions and 2 deletions
|
@ -89,7 +89,10 @@
|
|||
* --------------------------------------------------------------------------- */
|
||||
|
||||
$(document).on('click', '.navbar-collapse.in', function(e) {
|
||||
if ( $(e.target).is('a') && $(e.target).attr('class') != 'dropdown-toggle' ) {
|
||||
//get the <a> element that was clicked, even if the <span> element that is inside the <a> element is e.target
|
||||
let targetElement = $(e.target).is('a') ? $(e.target) : $(e.target).parent();
|
||||
|
||||
if (targetElement.is('a') && targetElement.attr('class') != 'dropdown-toggle') {
|
||||
$(this).collapse('hide');
|
||||
}
|
||||
});
|
||||
|
@ -164,7 +167,6 @@
|
|||
* --------------------------------------------------------------------------- */
|
||||
|
||||
$(window).on('load', function() {
|
||||
|
||||
if (window.location.hash) {
|
||||
// When accessing homepage from another page and `#top` hash is set, show top of page (no hash).
|
||||
if (window.location.hash == "#top") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue