зеркало из https://github.com/mozilla/treeherder.git
Bug 1240211 - Disable the checkbox for the single remaining selected tier (#1841) r=camd
This commit is contained in:
Коммит
5da40df112
|
@ -204,6 +204,11 @@ treeherderApp.controller('MainCtrl', [
|
|||
* This new solution uses a simple model scope object and update function
|
||||
* to keep things in sync.
|
||||
*/
|
||||
|
||||
$scope.isSingleTierSelected = function() {
|
||||
return _.without(_.values($scope.tiers), false).length === 1;
|
||||
};
|
||||
|
||||
$scope.isTierShowing = function(tier) {
|
||||
return thJobFilters.isFilterSetToShow("tier", tier);
|
||||
};
|
||||
|
|
|
@ -27,11 +27,12 @@
|
|||
role="menu">
|
||||
<li ng-repeat="tier in jobFilters.tiers">
|
||||
<div class="checkbox dropdown-link">
|
||||
<label>
|
||||
<label title="{{(isSingleTierSelected() && tiers[tier] == true) ? 'Must have at least one tier selected at all times' : ''}}">
|
||||
<input id="tier-checkbox"
|
||||
type="checkbox"
|
||||
class="dropdown-checkboxk"
|
||||
ng-model="tiers[tier]"
|
||||
ng-disabled="isSingleTierSelected() && tiers[tier] == true"
|
||||
ng-change="tierToggled(tier)">
|
||||
tier {{::tier}}
|
||||
</label>
|
||||
|
|
Загрузка…
Ссылка в новой задаче