Commit 5a0a5435a44903d1461b61c20825fcb47ed0604c
Exists in
master
and in
1 other branch
Merge branch 'master' of git.ucsd.edu:110swag/flashy-frontend
merigin
Showing 2 changed files Side-by-side Diff
scripts/CardGridController.js
View file @
5a0a543
... | ... | @@ -28,19 +28,19 @@ |
28 | 28 | height: (width * 3 / 5) + 'px' |
29 | 29 | }); |
30 | 30 | }; |
31 | - | |
32 | 31 | $scope.refreshLayout = function() { |
33 | 32 | numCols = Math.max(1, Math.floor(($window.innerWidth - 17) / 250)); |
34 | 33 | |
35 | 34 | // check if we actually need to refresh the whole layout |
36 | 35 | if (numCols == $scope.numCols) return $scope.refreshColumnWidth(); |
37 | 36 | $scope.numCols = numCols; |
38 | - console.log('refreshing layout for ' + $scope.numCols + ' columns'); | |
37 | + console.log('refreshing layout for ' + numCols + ' columns'); | |
39 | 38 | $scope.cardCols = []; |
40 | 39 | var cols = []; |
41 | - for (i = 0; i < $scope.numCols; i++) cols.push([]); | |
42 | - $scope.cards.forEach(function(card, i) { | |
43 | - card.colNum = i % $scope.numCols; | |
40 | + for (var i = 0; i < numCols; i++) cols.push([]); | |
41 | + var n = 0; | |
42 | + $scope.cards.forEach(function(card, j) { | |
43 | + card.colNum = n++ % numCols; | |
44 | 44 | cols[card.colNum].push(card); |
45 | 45 | }); |
46 | 46 | for (i in cols) $scope.updateColRanks(cols[i]); |
scripts/FeedController.js
View file @
5a0a543