Commit 4ae9d92c authored by Hervé Ménager's avatar Hervé Ménager

precompute the span for the sections in the welcome page

parent a3c68ac6
......@@ -54,6 +54,14 @@ angular.module('biowebEvolApp')
'icon':'fa-compass'
},
];
// this loop precomputes the span of the different sections
for (var i = 0; i < $scope.sections.length; i++) {
if($scope.sections.length%2===1 && i>=$scope.sections.length-3){
$scope.sections[i].colSpan = 4;
}else{
$scope.sections[i].colSpan = 6;
}
}
$scope.matches = {};
$scope.loading = {};
var load = function(){
......
......@@ -33,6 +33,12 @@
text-decoration: none!important;
}
.thumbnail h2{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
......
......@@ -19,7 +19,7 @@
<news-list limit="20"></news-list>
</section>
<section class="col-md-8 col-xs-12">
<div class="col-md-6" ng-repeat="section in sections">
<div class="col-md-{{section.colSpan}}" ng-repeat="section in sections">
<a href="/{{section.name}}{{routeParams.search ? '?search='+routeParams.search : ''}}" class="thumbnail" ng-class="routeParams.search ? (matches[section.name]==0 ? 'text-muted' : 'text-match') : ''">
<h2>
<i class="fa fa-large {{section.icon}}"></i>&nbsp;{{matches[section.name]}}&nbsp;{{section.label}}</h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment