Created
January 14, 2015 21:55
-
-
Save brunobar79/6e151e4c09e72f711cc7 to your computer and use it in GitHub Desktop.
column-width-stuff
This file contains hidden or 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
| var columnWidthSupported = typeof(document.body.style.webkitColumnWidth || document.body.style.mozColumnWidth)!== undefined; | |
| var columns = [], | |
| col_count = 2; | |
| if($rootScope.matchMedia.small){ | |
| col_count = 4; | |
| }else if($rootScope.matchMedia.smallPortrait){ | |
| col_count = 6; | |
| } | |
| var col_size = Math.floor(cities.length / col_count); | |
| var current_col = 0; | |
| for(var i=0; i<col_count; i++){ | |
| var from = col_count-1*i; | |
| to = from + col_size; | |
| columns[col_count-1] = cities.slice(from, to); | |
| } | |
| <div ng-if="!columnWidthSupported" ng-repeat="for col in cols"> | |
| <div ng-repeat="for city in cols"> | |
| </div> | |
| </div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment