Skip to content

Commit 8b4b641

Browse files
Bug fix for back2top button in sidebar
1 parent a37f6bd commit 8b4b641

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

layout/_macro/sidebar.swig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
{% endif %}
188188

189189
{% if theme.back2top.enable and theme.back2top.sidebar %}
190-
<div class="back-to-top">
190+
<div class="back-to-top motion-element">
191191
<i class="fa fa-arrow-up"></i>
192192
{% if theme.back2top.scrollpercent %}
193193
<span id="scrollpercent"><span>0</span>%</span>

layout/_partials/head/head.swig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
scheme: '{{ theme.scheme }}',
9696
version: '{{ version }}',
9797
sidebar: {{ theme.sidebar | json_encode }},
98-
back2top: {{ theme.back2top.enable }},
99-
back2top_sidebar: {{ theme.back2top.sidebar }},
98+
back2top: {{ theme.back2top | json_encode }},
10099
fancybox: {{ theme.fancybox }},
101100
fastclick: {{ theme.fastclick }},
102101
lazyload: {{ theme.lazyload }},

source/js/next-boot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $(document).ready(function() {
1111

1212
NexT.utils.registerESCKeyEvent();
1313

14-
CONFIG.back2top && NexT.utils.registerBackToTop();
14+
CONFIG.back2top.enable && NexT.utils.registerBackToTop();
1515

1616
// Mobile top menu bar.
1717
$('.site-nav-toggle button').on('click', function() {

source/js/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ NexT.utils = {
275275
},
276276

277277
getSidebarb2tHeight: function() {
278-
var sidebarb2tHeight = (CONFIG.back2top && CONFIG.back2top_sidebar) ? $('.back-to-top').height() : 0;
278+
var sidebarb2tHeight = (CONFIG.back2top.enable && CONFIG.back2top.sidebar) ? $('.back-to-top').height() : 0;
279279
return sidebarb2tHeight;
280280
},
281281

0 commit comments

Comments
 (0)