Skip to content

Commit

Permalink
fix js error if navigation is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
seibtph committed Mar 27, 2020
1 parent abff47a commit e4ff25c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Module/OddThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class OddThemeSetup extends \BackendModule
{
const VERSION = '1.2.0';
const VERSION = '1.2.1';

protected $strTemplate = 'be_oddtheme_setup';

Expand Down
14 changes: 8 additions & 6 deletions src/Resources/public/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ jQuery.noConflict(); jQuery(document).ready(function($) {
e.preventDefault();
});

var myElement = document.querySelector("#header .nav-container");
if( !$("#header .nav-container").hasClass("disable-headroom") ) {
var headroom = new Headroom(myElement, {
"offset": 600
});
headroom.init();
if( $("#header .nav-container").length > 0 ) {
var myElement = document.querySelector("#header .nav-container");
if( !$("#header .nav-container").hasClass("disable-headroom") ) {
var headroom = new Headroom(myElement, {
"offset": 600
});
headroom.init();
}
}

/* ===================== *
Expand Down

0 comments on commit e4ff25c

Please sign in to comment.