Hide and don't use the header hitzone when unnecessary.

This commit is contained in:
Mayhem 2014-03-20 16:21:22 +01:00
parent 676381c974
commit d1a305a888
2 changed files with 7 additions and 4 deletions

View File

@ -165,6 +165,9 @@ a[href="javascript:;"] {
height: 10px;
position: absolute;
}
#header-bar:not(.autohide) #header-bar-hitzone {
display: none;
}
#header.top #header-bar-hitzone {
bottom: -10px;
}

View File

@ -4,8 +4,8 @@ Header =
id: 'header'
innerHTML: <%= importHTML('General/Header') %>
@bar = $ '#header-bar', headerEl
@toggle = $ '#header-bar-hitzone', @bar
@bar = $ '#header-bar', headerEl
@hitzone = $ '#header-bar-hitzone', @bar
@noticesRoot = $ '#notifications', headerEl
@menu = new UI.Menu 'header'
@ -281,14 +281,14 @@ Header =
getTopOf: (root) ->
{top} = root.getBoundingClientRect()
unless Conf['Bottom header']
headRect = Header.toggle.getBoundingClientRect()
headRect = (if $.hasClass Header.bar, 'autohide' then Header.hitzone else Header.bar).getBoundingClientRect()
top -= headRect.top + headRect.height
top
getBottomOf: (root) ->
{clientHeight} = doc
bottom = clientHeight - root.getBoundingClientRect().bottom
if Conf['Bottom header']
headRect = Header.toggle.getBoundingClientRect()
headRect = (if $.hasClass Header.bar, 'autohide' then Header.hitzone else Header.bar).getBoundingClientRect()
bottom -= clientHeight - headRect.bottom + headRect.height
bottom
isHidden: ->