mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Take potential padding into account when calculating proj list height.
This commit is contained in:
parent
c488916c69
commit
f47dac6414
1 changed files with 5 additions and 15 deletions
|
@ -26,22 +26,12 @@ define [
|
|||
storedUIOpts = JSON.parse(localStorage("project_list"))
|
||||
|
||||
recalculateProjectListHeight = () ->
|
||||
topOffset = $(".project-list-card")?.offset()?.top
|
||||
bottomOffset = $("footer").outerHeight() + 25
|
||||
sideBarHeight = $("aside").height() - 56
|
||||
# When footer is visible and page doesn't need to scroll we just make it
|
||||
# span between header and footer
|
||||
height = $window.innerHeight - topOffset - bottomOffset
|
||||
|
||||
# When page is small enough that this pushes the project list smaller than
|
||||
# the side bar, then the window going to have to scroll to take into account the
|
||||
# footer. So we now start to track to the bottom of the window, with a 25px padding
|
||||
# since the footer is hidden below the fold. Don't ever get bigger than the sidebar
|
||||
# though since that's what triggered this happening in the first place.
|
||||
# if height < sideBarHeight
|
||||
# height = Math.min(sideBarHeight, $window.innerHeight - topOffset - 25)
|
||||
$projListCard = $(".project-list-card")
|
||||
topOffset = $projListCard?.offset()?.top
|
||||
cardPadding = $projListCard?.outerHeight() - $projListCard?.height()
|
||||
bottomOffset = $("footer").outerHeight()
|
||||
height = $window.innerHeight - topOffset - bottomOffset - cardPadding
|
||||
$scope.projectListHeight = height
|
||||
|
||||
|
||||
angular.element($window).bind "resize", () ->
|
||||
recalculateProjectListHeight()
|
||||
|
|
Loading…
Reference in a new issue