Skip to content

Commit e7e0d6c

Browse files
1v9stevenjoezhang
authored andcommitted
Fix known issues (theme-next#1213)
1 parent 0a3f3c3 commit e7e0d6c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

layout/_partials/sidebar/site-overview.swig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,15 @@
8585
{%- for name, link in theme.social %}
8686
<span class="links-of-author-item">
8787
{%- set sidebarURL = link.split('||')[0] | trim %}
88-
{%- if not (theme.social_icons.enable) or (not theme.social_icons.icons_only) %}
89-
{%- set sidebarText = name %}
90-
{%- endif %}
9188
{%- if theme.social_icons.enable %}
9289
{%- set sidebarIcon = '<i class="fa fa-fw fa-' + link.split('||')[1] | trim + '"></i>' %}
90+
{%- else %}
91+
{%- set sidebarIcon = '' %}
92+
{%- endif %}
93+
{%- if theme.social_icons.enable and theme.social_icons.icons_only %}
94+
{%- set sidebarText = '' %}
95+
{%- else %}
96+
{%- set sidebarText = name %}
9397
{%- endif %}
9498
{{ next_url(sidebarURL, sidebarIcon + sidebarText, {title: name + ' &rarr; ' + sidebarURL}) }}
9599
</span>

source/js/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ NexT.utils = {
276276
index = sections.indexOf(entry.target);
277277
return index === 0 ? 0 : index - 1;
278278
}
279-
for (;index < entries.length; index++) {
279+
for (; index < entries.length; index++) {
280280
if (entries[index].boundingClientRect.top <= 0) {
281281
entry = entries[index];
282282
} else {
@@ -301,7 +301,9 @@ NexT.utils = {
301301
rootMargin: marginTop + 'px 0px -100% 0px',
302302
threshold : 0
303303
});
304-
sections.forEach(item => intersectionObserver.observe(item));
304+
sections.forEach(item => {
305+
item && intersectionObserver.observe(item);
306+
});
305307
}
306308
createIntersectionObserver(document.documentElement.scrollHeight);
307309
},

0 commit comments

Comments
 (0)