Skip to content

Commit 369678b

Browse files
authored
Merge pull request #257 from loremipsum31/master
replace JS addClass 'fixed' by PHP alternative
2 parents b313c27 + 7599fc2 commit 369678b

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

header.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<?php if ( visualcomposerstarter_is_the_header_displayed() ) : ?>
2424
<?php visualcomposerstarter_hook_before_header(); ?>
2525
<header id="header">
26-
<nav class="navbar">
26+
<nav class="navbar<?php echo ( in_array( 'fixed-header', get_body_class() ) ) ? ' fixed' : ''; ?>">
2727
<div class="<?php echo esc_attr( visualcomposerstarter_get_header_container_class() ); ?>">
2828
<div class="navbar-wrapper clearfix">
2929
<div class="navbar-header">

js/functions.js

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
// Fixed header
3434
if ( $body.hasClass( 'fixed-header' ) ) {
35-
$navBar.addClass( 'fixed' );
3635
if ( ! $body.hasClass( 'navbar-no-background' ) ) {
3736
$body.css( { paddingTop: $navBar.outerHeight() } );
3837
} else {

js/functions.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)