Commit ae7b202e authored by Ingo Malchow's avatar Ingo Malchow

Merge branch 'develop' of git.kde.org:websites/neverland into develop

parents 1433270e 9d50c402
/* Elements */
var $sidebar = $("#navSidebarNeverland");
var $footer = $(".navbar-bottom");
var $fixedFooter = $("footer");
var $tableFilter = $(".table-filtered");
var $popup = $("#modal-onload");
var $clear = $(".input-clear");
......@@ -17,6 +16,7 @@ var componentClearInput = true;
var viewportHeight;
var footerHeight;
var footerTop;
var footerMargin;
var sidebarHeight;
var sidebarFloatPoint;
var sidebarFixPoint;
......@@ -29,6 +29,7 @@ $(window).on("scroll", onScrollHandler);
/* Event handlers */
function onLoadHandler() {
doCheckComponents();
doCaptureScreenInitialData();
doCaptureScreenData();
doScrollSpy();
doFloatingFooter();
......@@ -46,6 +47,7 @@ function onResizeHandler() {
}
function onScrollHandler() {
doCaptureScreenData();
doFloatingFooter();
doFloatingSidebar();
}
......@@ -53,20 +55,34 @@ function onScrollHandler() {
/* Action methods */
function doCheckComponents() {
componentPopup = componentPopup ? $popup.length != 0 : false;
componentFooter = componentFooter ? $footer.length != 0 && $fixedFooter.length != 0 :false;
componentFooter = componentFooter ? $footer.length != 0 :false;
componentSidebar = componentSidebar ? $sidebar.length != 0 : false;
componentClearInput = componentClearInput ? $clear.length != 0 : false;
componentTableFilter = componentTableFilter ? $tableFilter.length != 0 && typeof($.fn.columnFilters) == 'function'
: false;
}
function doCaptureScreenInitialData() {
try {
if (componentFooter) {
var relativeOffset = $footer.prev().offset().top + $footer.prev().outerHeight();
var actualOffset = $footer.offset().top;
footerMargin = actualOffset - relativeOffset;
}
} catch(e) {
console.log("Error: " + e.message);
}
}
function doCaptureScreenData() {
try {
viewportHeight = $(window).height();
if (componentFooter) {
footerHeight = $footer.height();
footerTop = $fixedFooter.offset().top + footerHeight;
footerTop = $footer.prev().offset().top + $footer.prev().outerHeight();
footerTop = footerTop + footerMargin + footerHeight;
}
if (componentFooter && componentSidebar) {
......@@ -98,7 +114,6 @@ function doFloatingFooter() {
if (windowBottom > footerTop) {
$footer.removeClass("fixed");
} else {
doCaptureScreenData();
$footer.addClass("fixed");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment