Created
November 24, 2012 10:32
-
-
Save timothyklim/4139122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tr ng-repeat="chunksetsBuf in splitChunksetsArray[for_id]" | |
td.group ng-repeat="(index, col) in chunksetsBuf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.chunksets = Chunksets.get {} | |
$scope.splitChunksetsArray = {} | |
$scope.splitChunksets = -> | |
index = 0 | |
$scope.splitChunksetsArray = {} | |
buf = [] | |
_.each $scope.chunksets, (chunksets, kind) -> | |
$scope.splitChunksetsArray[kind] = [] | |
_.each chunksets, (set) -> | |
index += 1 | |
buf.push set | |
if index == 4 | |
$scope.splitChunksetsArray[kind].push buf | |
index = 0 | |
buf = [] | |
$scope.splitChunksetsArray[kind].push buf unless _.isEmpty(buf) | |
$scope.splitChunksets() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment