mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Auto resize project list to always fit in screen
This commit is contained in:
parent
ff7b7cdd20
commit
4423471b1a
4 changed files with 19 additions and 1 deletions
|
@ -233,6 +233,7 @@ block content
|
|||
ul.list-unstyled.project-list.structured-list(
|
||||
select-all-list,
|
||||
ng-if="projects.length > 0",
|
||||
max-height="windowHeight - 290",
|
||||
ng-cloak
|
||||
)
|
||||
li.container-fluid
|
||||
|
|
11
services/web/public/coffee/directives/maxHeight.coffee
Normal file
11
services/web/public/coffee/directives/maxHeight.coffee
Normal file
|
@ -0,0 +1,11 @@
|
|||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.directive "maxHeight", () ->
|
||||
return {
|
||||
restrict: "A"
|
||||
link: (scope, element, attrs) ->
|
||||
scope.$watch attrs.maxHeight, (value) ->
|
||||
if value?
|
||||
element.css("max-height": value)
|
||||
}
|
|
@ -11,6 +11,7 @@ define [
|
|||
"directives/fineUpload"
|
||||
"directives/onEnter"
|
||||
"directives/selectAll"
|
||||
"directives/maxHeight"
|
||||
"filters/formatDate"
|
||||
], () ->
|
||||
angular.bootstrap(document.body, ["SharelatexApp"])
|
|
@ -50,7 +50,7 @@ define [
|
|||
|
||||
]
|
||||
|
||||
App.controller "ProjectPageController", ($scope, $modal, $q, queuedHttp) ->
|
||||
App.controller "ProjectPageController", ($scope, $modal, $q, $window, queuedHttp) ->
|
||||
$scope.projects = window.data.projects
|
||||
$scope.visibleProjects = $scope.projects
|
||||
$scope.tags = window.data.tags
|
||||
|
@ -58,6 +58,11 @@ define [
|
|||
$scope.selectedProjects = []
|
||||
$scope.filter = "all"
|
||||
|
||||
$scope.windowHeight = $window.innerHeight
|
||||
angular.element($window).bind "resize", () ->
|
||||
$scope.windowHeight = $window.innerHeight
|
||||
$scope.$apply()
|
||||
|
||||
# Allow tags to be accessed on projects as well
|
||||
projectsById = {}
|
||||
for project in $scope.projects
|
||||
|
|
Loading…
Reference in a new issue