From e7e0d6c316c71017d21661dddcb433b14aa25b87 Mon Sep 17 00:00:00 2001 From: 1v9 Date: Sat, 19 Oct 2019 20:51:32 +0800 Subject: [PATCH] Fix known issues (#1213) --- layout/_partials/sidebar/site-overview.swig | 10 +++++++--- source/js/utils.js | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/layout/_partials/sidebar/site-overview.swig b/layout/_partials/sidebar/site-overview.swig index eaa18a52e1..a7cb290889 100644 --- a/layout/_partials/sidebar/site-overview.swig +++ b/layout/_partials/sidebar/site-overview.swig @@ -85,11 +85,15 @@ {%- for name, link in theme.social %} {%- set sidebarURL = link.split('||')[0] | trim %} - {%- if not (theme.social_icons.enable) or (not theme.social_icons.icons_only) %} - {%- set sidebarText = name %} - {%- endif %} {%- if theme.social_icons.enable %} {%- set sidebarIcon = '' %} + {%- else %} + {%- set sidebarIcon = '' %} + {%- endif %} + {%- if theme.social_icons.enable and theme.social_icons.icons_only %} + {%- set sidebarText = '' %} + {%- else %} + {%- set sidebarText = name %} {%- endif %} {{ next_url(sidebarURL, sidebarIcon + sidebarText, {title: name + ' → ' + sidebarURL}) }} diff --git a/source/js/utils.js b/source/js/utils.js index 2899f6ff5e..5d6d44762e 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -276,7 +276,7 @@ NexT.utils = { index = sections.indexOf(entry.target); return index === 0 ? 0 : index - 1; } - for (;index < entries.length; index++) { + for (; index < entries.length; index++) { if (entries[index].boundingClientRect.top <= 0) { entry = entries[index]; } else { @@ -301,7 +301,9 @@ NexT.utils = { rootMargin: marginTop + 'px 0px -100% 0px', threshold : 0 }); - sections.forEach(item => intersectionObserver.observe(item)); + sections.forEach(item => { + item && intersectionObserver.observe(item); + }); } createIntersectionObserver(document.documentElement.scrollHeight); },