Skip to content

Commit

Permalink
Fix 404 error page height on load when navbar not visible
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Sep 7, 2020
1 parent 6b3aedc commit be62c89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/static/js/main-singlelayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt



// Document on load
// Document on DOM ready
$(function() {
setHeroHeight();
loaderPage();
Expand Down
15 changes: 7 additions & 8 deletions assets/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt

// Fullsize Error Page Background
var fullHeight = function() {
$('#error-page').css('height', $(window).height() - $('.js-sticky').height() - $('#fh5co-footer').outerHeight());
var heightToSet = $(window).height() - $('.js-sticky').height() - $('#fh5co-footer').outerHeight();
$('#error-page').css('height', heightToSet);
};

var setFullHeight = function() {
Expand All @@ -38,9 +39,7 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt
$('body').prepend('<a href="#" class="js-fh5co-nav-toggle fh5co-nav-toggle" aria-label="Toggle for hamburger menu"><i></i></a>');

$('.fh5co-main-nav .fh5co-menu-1 a, .fh5co-main-nav .fh5co-menu-2 a').each(function(){

var $this = $(this);

$('#fh5co-offcanvas').append($this.clone());
});
// $('#fh5co-offcanvas').append
Expand All @@ -53,9 +52,9 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt
var sticky = $('.js-sticky');
var $section = $('.fh5co-main-nav');

sticky.css('height', sticky.height());
sticky.css('height', $section.height());
$(window).on('resize', function(){
sticky.css('height', $section.height());
sticky.css('height', $section.height());
});

$section.waypoint(function(direction) {
Expand Down Expand Up @@ -112,13 +111,13 @@ https://github.com/spyder-ide/lektor-icon/blob/master/NOTICE.txt



// Document on load
// Document on DOM ready
$(function(){
offcanvasMenu();
mainMenuSticky();
setFullHeight();
burgerMenu();
mobileMenuOutsideClick();
mainMenuSticky();
setFullHeight();
});

}());

0 comments on commit be62c89

Please sign in to comment.