Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Change behaviour, no picto, default picto #794

Merged
merged 1 commit into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/app/categories/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,6 @@ function CategoriesListeController($scope, $rootScope, $location, $timeout, util
return !el.filter_rando
};

$scope.checkPictogram = function checkPictogram (el) {
return !el.pictogram
};

function initCatFilters() {
initDatePickers();
initRangeFilters();
Expand Down
9 changes: 5 additions & 4 deletions src/app/categories/templates/categories-liste.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
</div>
</div>
<!-- Other filter selector -->
<div ng-if="category.labels && category.labels.values.length > 0 && !category.labels.values.every(checkFilterRando) && !category.labels.values.every(checkPictogram)" class="category-filter selector labels" ng-class="{empty: category.labels.values.length === 0}">
<div ng-if="category.labels && category.labels.values.length > 0 && !category.labels.values.every(checkFilterRando)" class="category-filter selector labels" ng-class="{empty: category.labels.values.length === 0}">
<div class="filter-title">
<span>{{'OTHERS' | translate}}</span>
</div>
Expand All @@ -283,14 +283,15 @@
<input type="checkbox" id="label-{{::label.id}}" ng-click="toogleCategoryFilter(category.id, 'labels', label.id)"
ng-checked="activeFilters[category.id + '_labels'].indexOf(label.id.toString()) > -1" />
<label for="label-{{label.id}}">
<span ng-if="label.pictogram">
<span>
<div class="choice-tick">
<img ng-if="activeFilters[category.id + '_labels'].indexOf(label.id.toString()) > -1"
src="/images/icons/filter-check.svg" />
</div>
<span class="category-filters-theme-icon choice-icon">
<ng-include ng-if="label.pictogram | isSVG" src="label.pictogram"></ng-include>
<img ng-if="!(label.pictogram | isSVG)" ng-src="{{label.pictogram}}" ng-alt="{{label.name}}">
<ng-include ng-if="label.pictogram && label.pictogram | isSVG" src="label.pictogram"></ng-include>
<img ng-if="label.pictogram && !(label.pictogram | isSVG)" ng-src="{{label.pictogram}}" ng-alt="{{label.name}}">
<ng-include ng-if="!label.pictogram" src="'/images/icons/warning.svg'"></ng-include>
</span>
</span>
</label>
Expand Down