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) @main.unbind('scroll', @positionPageHeaderUpdate)
positionPageHeaderUpdate: => positionPageHeaderUpdate: =>
pageHeader = @scrollPageHeader.height() headerHeight = @scrollPageHeader.outerHeight()
mainScrollHeigth = @main.prop('scrollHeight') mainScrollHeigth = @main.prop('scrollHeight')
mainHeigth = @main.height() mainHeigth = @main.height()
# if page header is possible to use, show page header # if page header is possible to use, show page header
top = 0 top = 0
if mainScrollHeigth > mainHeigth + pageHeader if mainScrollHeigth > mainHeigth + headerHeight
offset = @ticketZoom.offset() scroll = @main.scrollTop()
if offset.top >= 0 if scroll <= headerHeight
top = offset.top top = (scroll - headerHeight)
# if page header is not possible to use - mainScrollHeigth to low - hide page header # if page header is not possible to use - mainScrollHeigth to low - hide page header
else 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) => render: (force) =>