make scrollHeader fully dissapear

by using scroll offset of the scroll parent (previously the headers bottom border was still visible because it only scrolled up 62px instead its full height of 64px)
This commit is contained in:
Felix Niklas 2014-12-16 15:35:49 +01:00
parent 3793c85a0e
commit 123e628c19

View file

@ -160,23 +160,22 @@ class App.TicketZoom extends App.Controller
@main.unbind('scroll', @positionPageHeaderUpdate)
positionPageHeaderUpdate: =>
pageHeader = @scrollPageHeader.height()
headerHeight = @scrollPageHeader.outerHeight()
mainScrollHeigth = @main.prop('scrollHeight')
mainHeigth = @main.height()
# if page header is possible to use, show page header
top = 0
if mainScrollHeigth > mainHeigth + pageHeader
offset = @ticketZoom.offset()
if offset.top >= 0
top = offset.top
if mainScrollHeigth > mainHeigth + headerHeight
scroll = @main.scrollTop()
if scroll <= headerHeight
top = (scroll - headerHeight)
# if page header is not possible to use - mainScrollHeigth to low - hide page header
else
top = pageHeader
top = -headerHeight
#console.log('TOP', top, @ticket.id, new Date)
@scrollPageHeader.css('transform', "translateY(-#{top}px)")
@scrollPageHeader.css('transform', "translateY(#{top}px)")
render: (force) =>