while use locally, no need of ribbon

This commit is contained in:
geeyan 2016-01-08 18:00:44 +08:00
parent 6111ca46fa
commit fcbc6d84fb

View File

@ -108,12 +108,14 @@ $(function () {
function onResize() { function onResize() {
//Fix GitHub Ribbon overlapping Scrollbar //Fix GitHub Ribbon overlapping Scrollbar
var a = $('article'); var a = $('article');
if (ribbon[0] && a[0] && a[0].scrollHeight > $('.right-column').height()) { if (ribbon.length) {
if (a[0] && a[0].scrollHeight > $('.right-column').height()) {
ribbon[0].style.right = '16px'; ribbon[0].style.right = '16px';
} else { } else {
ribbon[0].style.right = ''; ribbon[0].style.right = '';
} }
} }
}
$(window).resize(_.debounce(onResize, 100)); $(window).resize(_.debounce(onResize, 100));
onResize(); onResize();
}); });