Skip to content

Instantly share code, notes, and snippets.

@brunobar79
Created January 14, 2015 21:55
Show Gist options
  • Select an option

  • Save brunobar79/6e151e4c09e72f711cc7 to your computer and use it in GitHub Desktop.

Select an option

Save brunobar79/6e151e4c09e72f711cc7 to your computer and use it in GitHub Desktop.
column-width-stuff
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