From 9dc9d96574f35a25ceec9901aab91f4b0ff5e62d Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 16 Feb 2014 04:16:33 -0700 Subject: [PATCH] Unread part of #579 --- builds/appchan-x.user.js | 8 ++++---- builds/crx/script.js | 8 ++++---- src/General/Header.coffee | 5 +++-- src/General/css/padding.nav.css | 2 +- src/General/css/padding.pages.css | 2 +- src/Theming/Style.coffee | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 24909d001..58adad34f 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -4295,7 +4295,7 @@ top = root.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.toggle.getBoundingClientRect(); - top -= headRect.top + headRect.height; + top -= headRect.top + headRect.height - 10; } return top; }, @@ -4305,7 +4305,7 @@ bottom = clientHeight - root.getBoundingClientRect().bottom; if (Conf['Bottom Header']) { headRect = Header.toggle.getBoundingClientRect(); - bottom -= clientHeight - headRect.bottom + headRect.height; + bottom -= clientHeight - headRect.bottom + headRect.height - 10; } return bottom; }, @@ -13798,8 +13798,8 @@ padding: function() { var navHeight, pageHeight, _ref; navHeight = Header.bar.offsetHeight; - pageHeight = (_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0; - return Style.sheets.padding.textContent = ("body { padding-bottom: 15px; padding-top: 15px; } .fourchan-ss-navigation.fixed.top-header:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom-header:not(.autohide) body::before { bottom: " + navHeight + "px; } .top-header:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom-header:not(.autohide) body { padding-bottom: " + (navHeight + 1) + "px; } ") + (pageHeight ? ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + pageHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + pageHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (pageHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (pageHeight + 1) + "px; }" : ''); + pageHeight = ((_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0) || 15; + return Style.sheets.padding.textContent = ("body { padding-bottom: 15px; padding-top: 15px; } .fourchan-ss-navigation.fixed.top-header:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom-header:not(.autohide) body::before { bottom: " + navHeight + "px; } .top-header:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom-header:not(.autohide) body { padding-bottom: " + (navHeight + 15) + "px; } ") + (pageHeight ? ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + pageHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + pageHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (pageHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (pageHeight + 15) + "px; }" : ''); } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 55db67cce..76279d6c5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4336,7 +4336,7 @@ top = root.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.toggle.getBoundingClientRect(); - top -= headRect.top + headRect.height; + top -= headRect.top + headRect.height - 10; } return top; }, @@ -4346,7 +4346,7 @@ bottom = clientHeight - root.getBoundingClientRect().bottom; if (Conf['Bottom Header']) { headRect = Header.toggle.getBoundingClientRect(); - bottom -= clientHeight - headRect.bottom + headRect.height; + bottom -= clientHeight - headRect.bottom + headRect.height - 10; } return bottom; }, @@ -13801,8 +13801,8 @@ padding: function() { var navHeight, pageHeight, _ref; navHeight = Header.bar.offsetHeight; - pageHeight = (_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0; - return Style.sheets.padding.textContent = ("body { padding-bottom: 15px; padding-top: 15px; } .fourchan-ss-navigation.fixed.top-header:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom-header:not(.autohide) body::before { bottom: " + navHeight + "px; } .top-header:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom-header:not(.autohide) body { padding-bottom: " + (navHeight + 1) + "px; } ") + (pageHeight ? ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + pageHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + pageHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (pageHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (pageHeight + 1) + "px; }" : ''); + pageHeight = ((_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0) || 15; + return Style.sheets.padding.textContent = ("body { padding-bottom: 15px; padding-top: 15px; } .fourchan-ss-navigation.fixed.top-header:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom-header:not(.autohide) body::before { bottom: " + navHeight + "px; } .top-header:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom-header:not(.autohide) body { padding-bottom: " + (navHeight + 15) + "px; } ") + (pageHeight ? ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + pageHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + pageHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (pageHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (pageHeight + 15) + "px; }" : ''); } }; diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 06a937134..929c2d475 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -342,7 +342,7 @@ Header = {top} = root.getBoundingClientRect() if Conf['Fixed Header'] and not Conf['Bottom Header'] headRect = Header.toggle.getBoundingClientRect() - top -= headRect.top + headRect.height + top -= headRect.top + headRect.height - 10 top getBottomOf: (root) -> @@ -350,8 +350,9 @@ Header = bottom = clientHeight - root.getBoundingClientRect().bottom if Conf['Bottom Header'] headRect = Header.toggle.getBoundingClientRect() - bottom -= clientHeight - headRect.bottom + headRect.height + bottom -= clientHeight - headRect.bottom + headRect.height - 10 bottom + isHidden: -> {top} = Header.bar.getBoundingClientRect() if Conf['Bottom header'] diff --git a/src/General/css/padding.nav.css b/src/General/css/padding.nav.css index d4a3f55e1..dcca8b9b4 100644 --- a/src/General/css/padding.nav.css +++ b/src/General/css/padding.nav.css @@ -12,5 +12,5 @@ body { padding-top: #{navHeight + 1}px; } .bottom-header:not(.autohide) body { - padding-bottom: #{navHeight + 1}px; + padding-bottom: #{navHeight + 15}px; } \ No newline at end of file diff --git a/src/General/css/padding.pages.css b/src/General/css/padding.pages.css index c5bf389ec..90f740a52 100644 --- a/src/General/css/padding.pages.css +++ b/src/General/css/padding.pages.css @@ -12,5 +12,5 @@ } .index.pagination-sticky-bottom body, .index.pagination-bottom body { - padding-bottom: #{pageHeight + 1}px; + padding-bottom: #{pageHeight + 15}px; } \ No newline at end of file diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index e7e941d94..f4baab4a1 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -188,7 +188,7 @@ Style = padding: -> navHeight = Header.bar.offsetHeight - pageHeight = ($ '.pagelist', d.body)?.offsetHeight + pageHeight = ($ '.pagelist', d.body)?.offsetHeight or 15 Style.sheets.padding.textContent = """<%= grunt.file.read('src/General/css/padding.nav.css').replace(/\s+/g, ' ').trim() %> """ + if pageHeight """<%= grunt.file.read('src/General/css/padding.pages.css').replace(/\s+/g, ' ').trim() %>"""