Просмотр исходного кода

Take potential padding into account when calculating proj list height.

Paulo Reis 9 лет назад
Родитель
Сommit
f47dac6414
1 измененных файлов с 5 добавлено и 15 удалено
  1. 5 15
      services/web/public/coffee/main/project-list/project-list.coffee

+ 5 - 15
services/web/public/coffee/main/project-list/project-list.coffee

@@ -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()