Fix Style.padding
This commit is contained in:
parent
e80797a0fb
commit
5af3407eda
@ -12519,13 +12519,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
padding: function() {
|
padding: function() {
|
||||||
var css;
|
var css, navHeight, pageHeight, _ref;
|
||||||
|
|
||||||
Style.padding.nav = Header.bar;
|
navHeight = Header.bar.offsetHeight;
|
||||||
Style.padding.pages = $('.pagelist', d.body);
|
pageHeight = (_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0;
|
||||||
css = "body { padding-bottom: 1px; } .fourchan-ss-navigation.fixed.top:not(.autohide) body::before { top: " + Style.padding.nav.offsetHeight + "px; } .fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before { bottom: " + Style.padding.nav.offsetHeight + "px; } .top:not(.autohide) body { padding-top: " + (Style.padding.nav.offsetHeight + 1) + "px; } .bottom:not(.autohide) body { padding-bottom: " + (Style.padding.nav.offsetHeight + 1) + "px;\" }";
|
css = "body { padding-bottom: 1px; } .fourchan-ss-navigation.fixed.top:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before { bottom: " + navHeight + "px; } .top:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom:not(.autohide) body { padding-bottom: " + (navHeight + 1) + "px; }";
|
||||||
if (Style.padding.pages) {
|
if (pageHeight) {
|
||||||
css += ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + Style.padding.pages.offsetHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + Style.padding.pages.offsetHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (Style.padding.pages.offsetHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (Style.padding.pages.offsetHeight + 1) + "px; }";
|
css += ".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; }";
|
||||||
}
|
}
|
||||||
return Style.paddingSheet.textContent = css;
|
return Style.paddingSheet.textContent = css;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -12512,13 +12512,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
padding: function() {
|
padding: function() {
|
||||||
var css;
|
var css, navHeight, pageHeight, _ref;
|
||||||
|
|
||||||
Style.padding.nav = Header.bar;
|
navHeight = Header.bar.offsetHeight;
|
||||||
Style.padding.pages = $('.pagelist', d.body);
|
pageHeight = (_ref = $('.pagelist', d.body)) != null ? _ref.offsetHeight : void 0;
|
||||||
css = "body { padding-bottom: 1px; } .fourchan-ss-navigation.fixed.top:not(.autohide) body::before { top: " + Style.padding.nav.offsetHeight + "px; } .fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before { bottom: " + Style.padding.nav.offsetHeight + "px; } .top:not(.autohide) body { padding-top: " + (Style.padding.nav.offsetHeight + 1) + "px; } .bottom:not(.autohide) body { padding-bottom: " + (Style.padding.nav.offsetHeight + 1) + "px;\" }";
|
css = "body { padding-bottom: 1px; } .fourchan-ss-navigation.fixed.top:not(.autohide) body::before { top: " + navHeight + "px; } .fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before { bottom: " + navHeight + "px; } .top:not(.autohide) body { padding-top: " + (navHeight + 1) + "px; } .bottom:not(.autohide) body { padding-bottom: " + (navHeight + 1) + "px; }";
|
||||||
if (Style.padding.pages) {
|
if (pageHeight) {
|
||||||
css += ".fourchan-ss-navigation.index.pagination-sticky-top body::before, .fourchan-ss-navigation.index.pagination-top body::before { top: " + Style.padding.pages.offsetHeight + "px; } .fourchan-ss-navigation.index.pagination-sticky-bottom body::before, .fourchan-ss-navigation.index.pagination-bottom body::before { bottom: " + Style.padding.pages.offsetHeight + "px; } .index.pagination-sticky-top body, .index.pagination-top body { padding-top: " + (Style.padding.pages.offsetHeight + 1) + "px; } .index.pagination-sticky-bottom body, .index.pagination-bottom body { padding-bottom: " + (Style.padding.pages.offsetHeight + 1) + "px; }";
|
css += ".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; }";
|
||||||
}
|
}
|
||||||
return Style.paddingSheet.textContent = css;
|
return Style.paddingSheet.textContent = css;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,14 +2,14 @@ body {
|
|||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
.fourchan-ss-navigation.fixed.top:not(.autohide) body::before {
|
.fourchan-ss-navigation.fixed.top:not(.autohide) body::before {
|
||||||
top: #{Style.padding.nav.offsetHeight}px;
|
top: #{navHeight}px;
|
||||||
}
|
}
|
||||||
.fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before {
|
.fourchan-ss-navigation.fixed.bottom:not(.autohide) body::before {
|
||||||
bottom: #{Style.padding.nav.offsetHeight}px;
|
bottom: #{navHeight}px;
|
||||||
}
|
}
|
||||||
.top:not(.autohide) body {
|
.top:not(.autohide) body {
|
||||||
padding-top: #{Style.padding.nav.offsetHeight + 1}px;
|
padding-top: #{navHeight + 1}px;
|
||||||
}
|
}
|
||||||
.bottom:not(.autohide) body {
|
.bottom:not(.autohide) body {
|
||||||
padding-bottom: #{Style.padding.nav.offsetHeight + 1}px;"
|
padding-bottom: #{navHeight + 1}px;
|
||||||
}
|
}
|
||||||
@ -1,16 +1,16 @@
|
|||||||
.fourchan-ss-navigation.index.pagination-sticky-top body::before,
|
.fourchan-ss-navigation.index.pagination-sticky-top body::before,
|
||||||
.fourchan-ss-navigation.index.pagination-top body::before {
|
.fourchan-ss-navigation.index.pagination-top body::before {
|
||||||
top: #{Style.padding.pages.offsetHeight}px;
|
top: #{pageHeight}px;
|
||||||
}
|
}
|
||||||
.fourchan-ss-navigation.index.pagination-sticky-bottom body::before,
|
.fourchan-ss-navigation.index.pagination-sticky-bottom body::before,
|
||||||
.fourchan-ss-navigation.index.pagination-bottom body::before {
|
.fourchan-ss-navigation.index.pagination-bottom body::before {
|
||||||
bottom: #{Style.padding.pages.offsetHeight}px;
|
bottom: #{pageHeight}px;
|
||||||
}
|
}
|
||||||
.index.pagination-sticky-top body,
|
.index.pagination-sticky-top body,
|
||||||
.index.pagination-top body {
|
.index.pagination-top body {
|
||||||
padding-top: #{Style.padding.pages.offsetHeight + 1}px;
|
padding-top: #{pageHeight + 1}px;
|
||||||
}
|
}
|
||||||
.index.pagination-sticky-bottom body,
|
.index.pagination-sticky-bottom body,
|
||||||
.index.pagination-bottom body {
|
.index.pagination-bottom body {
|
||||||
padding-bottom: #{Style.padding.pages.offsetHeight + 1}px;
|
padding-bottom: #{pageHeight + 1}px;
|
||||||
}
|
}
|
||||||
@ -191,11 +191,11 @@ Style =
|
|||||||
Header.addShortcut el, true
|
Header.addShortcut el, true
|
||||||
|
|
||||||
padding: ->
|
padding: ->
|
||||||
Style.padding.nav = Header.bar
|
navHeight = Header.bar.offsetHeight
|
||||||
Style.padding.pages = $ '.pagelist', d.body
|
pageHeight = ($ '.pagelist', d.body)?.offsetHeight
|
||||||
css = """<%= grunt.file.read('src/General/css/padding.nav.css').replace(/\s+/g, ' ').trim() %>"""
|
css = """<%= grunt.file.read('src/General/css/padding.nav.css').replace(/\s+/g, ' ').trim() %>"""
|
||||||
|
|
||||||
if Style.padding.pages
|
if pageHeight
|
||||||
css += """<%= grunt.file.read('src/General/css/padding.pages.css').replace(/\s+/g, ' ').trim() %>"""
|
css += """<%= grunt.file.read('src/General/css/padding.pages.css').replace(/\s+/g, ' ').trim() %>"""
|
||||||
|
|
||||||
Style.paddingSheet.textContent = css
|
Style.paddingSheet.textContent = css
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user