boday_tf/boday_it/static/js/base.js
2020-02-03 21:26:34 +01:00

50 lines
1.3 KiB
JavaScript

/*
* Copyright (c) 2013, Divio AG
* Licensed under BSD
* http://github.com/aldryn/aldryn-boilerplate-bootstrap3
*/
// #############################################################################
// NAMESPACES
/**
* @module Cl
*/
// istanbul ignore next
var Cl = window.Cl || {};
/* global outdatedBrowser */
// #############################################################################
// BASE
// istanbul ignore next
(function($) {
'use strict';
// shorthand for invoking jQuery(document).ready
$(function() {
// removes noscript form body and adds print-js
if (window.Cl && window.Cl.Utils) {
Cl.Utils._document();
}
// DOCS: https://github.com/burocratik/outdated-browser
if (window.outdatedBrowser) {
outdatedBrowser({
'languagePath': '',
'lowerThan': 'boxShadow'
});
}
// custom functions "botsicode"
const backTop = document.querySelector('.list-inline .pull-right'),
bodyContainer = document.querySelector('body>div.container'),
shBackTop = function() {
if (backTop && bodyContainer) {
backTop.style.opacity = +(bodyContainer.offsetTop + bodyContainer.getBoundingClientRect().height > window.innerHeight);
}
};
$(window).resize(shBackTop);
$(window).scroll(shBackTop);
shBackTop();
});
})(jQuery);