4da3dce2 by TaishiTokudome Committed by Yokihito Oki

cherry pick 34395a2c

1 parent 80e64bfa
......@@ -203,10 +203,9 @@ if ($this->params->get('logoFile')) {
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<script>
window.onload = function() {
jQuery(function($) {
var obj = $("#aside");
var offset = $(obj).offset();
var topPadding = 135;
var sW = window.innerWidth;
var sH = window.innerHeight;
var cW = obj.width();
......@@ -219,16 +218,22 @@ if ($this->params->get('logoFile')) {
if (document.querySelector(excludedPagesSelector)) {
isExcluded = true;
}
var customHeight = $(".custom").height();
var paddingTop = customHeight - 80;
if (cH) {
if (sH > cH) {
if (isExcluded) return false;
$(window).resize(function() {
customHeight = $(".custom").height();
paddingTop = customHeight - 80;
});
$(window).scroll(function() {
if ($(window).scrollTop() > offset.top) {
if ($(window).scrollTop() > customHeight) {
if ($(window).scrollTop() < cwrapH) {
$(obj).stop().animate({
duration: 'fast',
marginTop: $(window).scrollTop() - offset.top + topPadding
marginTop: $(window).scrollTop() - paddingTop
});
} else {
$(obj).stop().animate({});
......@@ -242,6 +247,7 @@ if ($this->params->get('logoFile')) {
}
}
});
};
</script>
</head>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!