project list minimal to work with projects

This commit is contained in:
Henry Oswald 2015-11-02 18:44:12 +00:00
parent c4d3537e1d
commit 0ef8d77ce3
2 changed files with 20 additions and 17 deletions

View file

@ -20,18 +20,16 @@ block content
.content.content-alt(ng-controller="ProjectPageController")
.container
.row
span(sixpack-switch="first_sign_up", ng-cloak)
.row(ng-cloak)
span(ng-if="first_sign_up == 'default' || projects.length > 0")
aside.col-md-2.col-xs-3
include ./list/side-bar
span(sixpack-default)
aside.col-md-2.col-xs-3
include ./list/side-bar
.col-md-10.col-xs-9
include ./list/project-list
span(sixpack-when="minimial")
.col-md-offset-2.col-md-8.col-md-offset-2.col-xs-8
include ./list/project-list-minimal
.col-md-10.col-xs-9
include ./list/project-list
span(ng-if="first_sign_up == 'minimial' && projects.length == 0")
.col-md-offset-2.col-md-8.col-md-offset-2.col-xs-8
include ./list/project-list-minimal
include ./list/modals

View file

@ -2,7 +2,7 @@ define [
"base"
], (App) ->
App.controller "ProjectPageController", ($scope, $modal, $q, $window, queuedHttp, event_tracking, $timeout) ->
App.controller "ProjectPageController", ($scope, $modal, $q, $window, queuedHttp, event_tracking, $timeout, sixpack) ->
$scope.projects = window.data.projects
$scope.tags = window.data.tags
$scope.allSelected = false
@ -11,8 +11,15 @@ define [
$scope.predicate = "lastUpdated"
$scope.reverse = true
sixpack.participate 'first_sign_up', ['default', 'minimial'], (chosenVariation, rawResponse)->
$scope.first_sign_up = chosenVariation
$timeout () ->
recalculateProjectListHeight()
, 10
recalculateProjectListHeight = () ->
topOffset = $(".project-list-card").offset().top
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
@ -28,9 +35,7 @@ define [
height = Math.min(sideBarHeight, $window.innerHeight - topOffset - 25)
$scope.projectListHeight = height
$timeout () ->
recalculateProjectListHeight()
, 0
angular.element($window).bind "resize", () ->
recalculateProjectListHeight()
$scope.$apply()