Detect autohiding scrollbar and shift header menu. #647

This commit is contained in:
ccd0 2016-04-03 15:46:46 -07:00
parent d9aa7657a7
commit 54c165b667
3 changed files with 11 additions and 0 deletions

View File

@ -1022,3 +1022,5 @@ Config =
replyPruning:
'Prune Replies': true
'Max Replies': 1000
'Autohiding Scrollbar': false

View File

@ -184,6 +184,12 @@ Main =
$.addClass doc, if g.VIEW is 'thread' then 'thread-view' else g.VIEW
$.addClass doc, $.engine if $.engine
$.onExists doc, '.ad-cnt', (ad) -> $.onExists ad, 'img', -> $.addClass doc, 'ads-loaded'
$.addClass doc, 'autohiding-scrollbar' if Conf['Autohiding Scrollbar']
$.ready ->
if d.body.clientHeight > doc.clientHeight and (window.innerWidth is doc.clientWidth) isnt Conf['Autohiding Scrollbar']
Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar']
$.set 'Autohiding Scrollbar', Conf['Autohiding Scrollbar']
$.toggleClass doc, 'autohiding-scrollbar'
$.addStyle Main.css, 'fourchanx-css'
Main.bgColorStyle = $.el 'style', id: 'fourchanx-bgcolor-css'

View File

@ -305,6 +305,9 @@ audio.controls-added {
#shortcuts {
float: right;
}
:root.autohiding-scrollbar #shortcuts {
margin-right: 12px;
}
.shortcut {
margin-left: 3px;
vertical-align: middle;