Disable metadata switch if only one item is available

Single metadata item on image details looks like action button,
which is confusing, so change cursor from pointer to default.

Closes-Bug: #1731884
Change-Id: I50b9a9c3878866249561a58c92aeafff4dffc949
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
This commit is contained in:
Anton Arefiev 2017-11-10 18:04:23 +01:00 committed by Ivan Kolodyazhny
parent 550cd12bf7
commit 59b18f3056
3 changed files with 11 additions and 3 deletions

View File

@ -3,9 +3,10 @@
.selector-item {
padding: $padding-base-vertical $padding-base-horizontal;
color: $link-color;
cursor: pointer;
border-radius: $nav-pills-border-radius;
&.clickable {
cursor: pointer;
}
&.active {
background: $nav-pills-active-link-hover-bg;
color: $nav-pills-active-link-hover-color;

View File

@ -76,6 +76,13 @@
return true; // break
}
});
ctrl.count = 0;
ctrl.tree.flatTree.some(function (i) {
if (ctrl.listFilter(i)) {
ctrl.count += 1;
}
});
}
}
})();

View File

@ -4,7 +4,7 @@
<div class="selector-item"
ng-repeat="item in ctrl.tree.flatTree | filter: ctrl.listFilter"
ng-click="ctrl.onSelect(item)"
ng-class="{ active: ctrl.selected === item }">
ng-class="{ active: ctrl.selected === item, clickable: ctrl.count > 1 }">
<span ng-bind="::item.label"></span>
</div>
</div>