diff --git a/docs-orange/assets/js/src/application-orange.js b/docs-orange/assets/js/src/application-orange.js index e5d11af861..1d2b65697e 100644 --- a/docs-orange/assets/js/src/application-orange.js +++ b/docs-orange/assets/js/src/application-orange.js @@ -9,61 +9,62 @@ $(document).ready(function () { - $(window).scroll(function () { - if ($(this).scrollTop() > 100) { - $('.scrollup').fadeIn(); - } else { - $('.scrollup').fadeOut(); - } - }); + $(window).scroll(function () { + if ($(this).scrollTop() > 100) { + $('.scrollup').fadeIn(); + } else { + $('.scrollup').fadeOut(); + } + }); + + $('.scrollup').click(function () { - $('.scrollup').click(function () { - $('html, body').animate({ - scrollTop: 0 - }, 600); - return false; - }); - }); + $('html, body').animate({ + scrollTop: 0 + }, 600); -}) + return false; + }); + }); + }) }(jQuery); (function () { - 'use strict'; + 'use strict'; - function isElementInViewport(el, topOffset) { - var rect = el.getBoundingClientRect(); + function isElementInViewport(el, topOffset) { + var rect = el.getBoundingClientRect(); - if (!topOffset){ topOffset = 0; } + if (!topOffset){ topOffset = 0; } - return rect.bottom > topOffset && - rect.right > 0 && - rect.left < (window.innerWidth || document. documentElement.clientWidth) && - rect.top < (window.innerHeight || document. documentElement.clientHeight); - } + return rect.bottom > topOffset && + rect.right > 0 && + rect.left < (window.innerWidth || document. documentElement.clientWidth) && + rect.top < (window.innerHeight || document. documentElement.clientHeight); + } - function onVisibilityChange(el) { - return function () { - var sidebar = document.getElementById('docsNavbarContent'); + function onVisibilityChange(el) { + return function () { + var sidebar = document.getElementById('docsNavbarContent'); - if (isElementInViewport(el)) { - sidebar.style.position = 'static'; - sidebar.style.top = 'auto'; - } else { - sidebar.style.position = 'fixed'; - sidebar.style.top = '0'; - } - }; - } + if (isElementInViewport(el)) { + sidebar.style.position = 'static'; + sidebar.style.top = 'auto'; + } else { + sidebar.style.position = 'fixed'; + sidebar.style.top = '0'; + } + }; + } - window.onload = function () { - var pageHeader = document.getElementById('page_header'); - var pageWatcher = onVisibilityChange(pageHeader); + window.onload = function () { + var pageHeader = document.getElementById('page_header'); + var pageWatcher = onVisibilityChange(pageHeader); - if (window.addEventListener) { - addEventListener('scroll', pageWatcher, false); - } else if (window.attachEvent) { - attachEvent('onscroll', pageWatcher); - } - }; + if (window.addEventListener) { + addEventListener('scroll', pageWatcher, false); + } else if (window.attachEvent) { + attachEvent('onscroll', pageWatcher); + } + }; })();