Skip to content

Commit

Permalink
add option to disable headroom.js, add minfied scripts file
Browse files Browse the repository at this point in the history
  • Loading branch information
seibtph committed Jul 20, 2020
1 parent 940db10 commit 9d2f946
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 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.4.2';
const VERSION = '1.4.3';

protected $strTemplate = 'be_oddtheme_setup';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
$combiner->add('bundles/pdirthemeodd/bootstrap/dist/js/bootstrap.min.js');
$combiner->add('bundles/pdirthemeodd/fontawesome/js/all.min.js');
$combiner->add('bundles/pdirthemeodd/js/headroom.min.js');
$combiner->add('bundles/pdirthemeodd/js/scripts.js');
$combiner->add('bundles/pdirthemeodd/js/scripts.min.js');
echo $combiner->getCombinedFile();
?>"></script>

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

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

/* ===================== *
Expand Down
1 change: 1 addition & 0 deletions src/Resources/public/js/scripts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d2f946

Please sign in to comment.