|
@@ -55,13 +55,17 @@
|
|
|
|
|
|
// Use scrollTo library to smoothly scroll between panels.
|
|
|
// Note that the admin bar lenght is only taken into consideration on screen size > 480px, when it becomes fixed.
|
|
|
- // Also, we take into account he height of the primary menu after 768px.
|
|
|
+ // Also, we take into account the height of the primary menu after 768px.
|
|
|
$navLinks.click( function() {
|
|
|
var yCoord = ( 1 === $adminBar.length && $( window ).outerWidth() > 480 ) ? $adminBar.outerHeight() : 0;
|
|
|
var offset = $( window ).outerWidth() > 768 ? $primaryMenu.outerHeight() : 0;
|
|
|
+ var offsetParams = {};
|
|
|
+ if ($('#wpadminbar').length > 0) {
|
|
|
+ offsetParams = { 'top': -1 * ( yCoord + offset ) };
|
|
|
+ }
|
|
|
$.scrollTo( $( this ).attr( 'href' ), {
|
|
|
duration: 400,
|
|
|
- offset: { 'top': -1 * ( yCoord + offset ) }
|
|
|
+ offset: offsetParams
|
|
|
} );
|
|
|
});
|
|
|
}
|