Fix #1384.
This commit is contained in:
parent
b5a1c3a287
commit
a8068c083f
@ -279,9 +279,21 @@ Header =
|
|||||||
scrollTo: (root, down, needed) ->
|
scrollTo: (root, down, needed) ->
|
||||||
if down
|
if down
|
||||||
x = Header.getBottomOf root
|
x = Header.getBottomOf root
|
||||||
|
if Conf['Header auto-hide on scroll'] and Conf['Bottom header']
|
||||||
|
{height} = Header.bar.getBoundingClientRect()
|
||||||
|
if x <= 0
|
||||||
|
x += height if !Header.isHidden()
|
||||||
|
else
|
||||||
|
x -= height if Header.isHidden()
|
||||||
window.scrollBy 0, -x unless needed and x >= 0
|
window.scrollBy 0, -x unless needed and x >= 0
|
||||||
else
|
else
|
||||||
x = Header.getTopOf root
|
x = Header.getTopOf root
|
||||||
|
if Conf['Header auto-hide on scroll'] and !Conf['Bottom header']
|
||||||
|
{height} = Header.bar.getBoundingClientRect()
|
||||||
|
if x >= 0
|
||||||
|
x += height if !Header.isHidden()
|
||||||
|
else
|
||||||
|
x -= height if Header.isHidden()
|
||||||
window.scrollBy 0, x unless needed and x >= 0
|
window.scrollBy 0, x unless needed and x >= 0
|
||||||
scrollToIfNeeded: (root, down) ->
|
scrollToIfNeeded: (root, down) ->
|
||||||
Header.scrollTo root, down, true
|
Header.scrollTo root, down, true
|
||||||
@ -298,6 +310,12 @@ Header =
|
|||||||
headRect = Header.toggle.getBoundingClientRect()
|
headRect = Header.toggle.getBoundingClientRect()
|
||||||
bottom -= clientHeight - headRect.bottom + headRect.height
|
bottom -= clientHeight - headRect.bottom + headRect.height
|
||||||
bottom
|
bottom
|
||||||
|
isHidden: ->
|
||||||
|
{top} = Header.bar.getBoundingClientRect()
|
||||||
|
if Conf['Bottom header']
|
||||||
|
top is doc.clientHeight
|
||||||
|
else
|
||||||
|
top < 0
|
||||||
|
|
||||||
addShortcut: (el, index) ->
|
addShortcut: (el, index) ->
|
||||||
shortcut = $.el 'span',
|
shortcut = $.el 'span',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user