Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and enhancements. [13] #1898

Merged
merged 57 commits into from
Sep 30, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
742d1ca
Merge pull request #22 from iissnan/master
ivan-nginx Sep 12, 2017
028fe60
MOD: move `getContentHeight` to variable.
ivan-nginx Sep 12, 2017
43dd4b4
FIX: jumping affix if sidebar taller then content.
ivan-nginx Sep 12, 2017
61086aa
MOD: rename `getContentHeight` function.
ivan-nginx Sep 12, 2017
619c49e
ADD: scrolling to active TOC if TOC > viewport.
ivan-nginx Sep 23, 2017
9ce276f
FIX: sidebar with `motion` on Mist & Muse schemes.
ivan-nginx Sep 23, 2017
e75a2a1
ADD: sidebar scrollable in all schemes [1].
ivan-nginx Sep 23, 2017
334e50e
ADD: sidebar scrollable in all schemes [2].
ivan-nginx Sep 23, 2017
59209cf
ADD: sidebar scrollable in all schemes [3].
ivan-nginx Sep 23, 2017
a8344d8
FIX: sidebar scrollable in all schemes [4].
ivan-nginx Sep 23, 2017
af067cd
ADD: sidebar scrollable in all schemes [5].
ivan-nginx Sep 23, 2017
65cb162
ADD: sidebar scrollable in all schemes [6].
ivan-nginx Sep 23, 2017
d23c0e0
ADD: sidebar scrollable in all schemes [7].
ivan-nginx Sep 23, 2017
0f27b0c
ADD: sidebar scrollable in all schemes [8].
ivan-nginx Sep 23, 2017
fd91285
ADD: sidebar scrollable in all schemes [9].
ivan-nginx Sep 23, 2017
e3d06b2
ADD: sidebar scrollable in all schemes [10].
ivan-nginx Sep 23, 2017
ef7905d
Merge branch 'master' into master
ivan-nginx Sep 23, 2017
cd92796
MOD: sidebar scrollable in all schemes [11].
ivan-nginx Sep 23, 2017
77b5a30
FIX: sidebar scrollable in all schemes [12].
ivan-nginx Sep 23, 2017
dca0ff4
FIX: sidebar scrollable in all schemes [13].
ivan-nginx Sep 23, 2017
920bd39
ADD: sidebar scrollable in all schemes [14].
ivan-nginx Sep 23, 2017
a0914e8
FIX: sidebar scrollable in all schemes [15].
ivan-nginx Sep 23, 2017
267109c
FIX: sidebar scrollable in all schemes [16].
ivan-nginx Sep 23, 2017
2f2e816
MOD: Enhancements to Gemini scheme [1].
ivan-nginx Sep 24, 2017
3a1b4c0
ADD: Enhancements to Gemini scheme [2].
ivan-nginx Sep 24, 2017
beb52f8
FIX: tabbed code block padding style [1].
ivan-nginx Sep 24, 2017
d433afd
FIX: tabbed code block padding style [2].
ivan-nginx Sep 24, 2017
41ff452
MOD: post more link margin-top refactor.
ivan-nginx Sep 24, 2017
b9243d9
FIX: site state items padding for Pisces & Gemini.
ivan-nginx Sep 24, 2017
7226ad4
MOD: Enhancements to Gemini scheme [3].
ivan-nginx Sep 24, 2017
87fa64e
MOD: Enhancements to Gemini scheme [4].
ivan-nginx Sep 24, 2017
cc2deca
Update readme. [skip ci]
ivan-nginx Sep 25, 2017
45d6254
Update readme [2]. [skip ci]
ivan-nginx Sep 25, 2017
74c34c9
FIX: sidebar scrollable in all schemes [17].
ivan-nginx Sep 28, 2017
42777af
FIX: sidebar scrollable in all schemes [18].
ivan-nginx Sep 28, 2017
7083a9d
FIX: sidebar scrollable in all schemes [19].
ivan-nginx Sep 28, 2017
1a6e24c
FIX: sidebar scrollable in all schemes [20].
ivan-nginx Sep 28, 2017
22569da
FIX: sidebar scrollable in all schemes [21].
ivan-nginx Sep 28, 2017
1280837
FIX: sidebar scrollable in all schemes [22].
ivan-nginx Sep 28, 2017
fa871de
FIX: sidebar scrollable in all schemes [23].
ivan-nginx Sep 28, 2017
11c5d1c
FIX: sidebar scrollable in all schemes [24].
ivan-nginx Sep 28, 2017
867fdbd
FIX: sidebar scrollable in all schemes [25].
ivan-nginx Sep 28, 2017
c2c2834
FIX: sidebar scrollable in all schemes [26].
ivan-nginx Sep 28, 2017
d8543f8
FIX: comments block only show if comments present.
ivan-nginx Sep 28, 2017
abb1424
FIX: comments block show if comments present [2].
ivan-nginx Sep 28, 2017
031244b
ADD: responsive favicons options [1].
ivan-nginx Sep 28, 2017
685b0ee
FIX: responsive favicons options [2].
ivan-nginx Sep 28, 2017
f406902
ADD: responsive favicons options [3].
ivan-nginx Sep 28, 2017
2ca6c06
ADD: responsive favicons options [4].
ivan-nginx Sep 28, 2017
0ed5ec9
FIX: Enhancements to Gemini scheme [5].
ivan-nginx Sep 29, 2017
00f7b64
ADD: Enhancements to Gemini scheme [6].
ivan-nginx Sep 29, 2017
36a3e31
MOD: Enhancements to Gemini scheme [7].
ivan-nginx Sep 29, 2017
7b41c6a
MOD: Enhancements to Gemini scheme [8].
ivan-nginx Sep 29, 2017
a558d60
ADD: Post custom copyright feature.
ivan-nginx Sep 30, 2017
9c33832
Update version to 5.1.3 [1].
ivan-nginx Sep 30, 2017
3a2f34d
Update version to 5.1.3 [2].
ivan-nginx Sep 30, 2017
88c3904
Update version to 5.1.3 [3].
ivan-nginx Sep 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions source/js/src/post-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,25 @@ $(document).ready(function () {

// Sidebar float
function initAffix () {
var headerHeight = $('.header-inner').height();
var footerOffset = parseInt($('.main').css('padding-bottom'), 10);
var headerHeight = $('.header-inner').height(),
sidebarHeight = $('.sidebar-inner').outerHeight(),
contentHeight = $('#content').height(),
footerOffset = $('.footer').height();

/*jshint camelcase: false */
var sidebarTop = (CONFIG.sidebar.offset_float === 0) ?
headerHeight + CONFIG.sidebar.offset :
headerHeight;
/*jshint camelcase: true */

if (sidebarTop + sidebarHeight < contentHeight) {
$('.sidebar-inner').affix({
offset: {
top: sidebarTop,
bottom: footerOffset
}
});
}

$(document)
.on('affixed.bs.affix', function () {
Expand Down
14 changes: 10 additions & 4 deletions source/js/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ NexT.utils = NexT.$u = {
$top.toggleClass('back-to-top-on', window.pageYOffset > THRESHOLD);

var scrollTop = $(window).scrollTop();
var docHeight = $('#content').height();
var winHeight = $(window).height();
var contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight);
var scrollPercent = (scrollTop) / (contentMath);
var contentVisibilityHeight = NexT.utils.getContentVisibilityHeight();
var scrollPercent = (scrollTop) / (contentVisibilityHeight);
var scrollPercentRounded = Math.round(scrollPercent*100);
var scrollPercentMaxed = (scrollPercentRounded > 100) ? 100 : scrollPercentRounded;
$('#scrollpercent>span').html(scrollPercentMaxed);
Expand Down Expand Up @@ -265,6 +263,14 @@ NexT.utils = NexT.$u = {
return scrollbarWidth;
},

getContentVisibilityHeight: function () {
var docHeight = $('#content').height(),
winHeight = $(window).height(),
contentVisibilityHeight = (docHeight > winHeight) ? (docHeight - winHeight) : ($(document).height() - winHeight);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.


return contentVisibilityHeight;
},

/**
* Affix behaviour for Sidebar.
*
Expand Down