align the use of input name attribute for checkboxes and radiobuttons

This commit is contained in:
Niels Lyngsø
2019-03-05 11:38:43 +01:00
parent a4d25dc594
commit 21405266ef
3 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<label class="radio umb-form-check umb-form-check--radiobutton">
<input type="radio" name="radiobuttons-{{name}}"
<input type="radio" name="{{name}}"
value="{{value}}"
ng-model="model"
class="umb-form-check__input" />

View File

@@ -37,13 +37,16 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.CheckboxListContro
//check if it's already in sync
//get the checked vals from the view model
var selectedVals = _.map(_.filter($scope.selectedItems,
var selectedVals = _.map(
_.filter($scope.selectedItems,
function(f) {
return f.checked;
}),
}
),
function(m) {
return m.value;
});
}
);
//get all of the same values between the arrays
var same = _.intersection($scope.model.value, selectedVals);
//if the lengths are the same as the value, then we are in sync, just exit

View File

@@ -2,7 +2,7 @@
<ul class="unstyled">
<li ng-repeat="item in selectedItems track by item.key">
<umb-checkbox name="checkboxlist" value="{{item.key}}" model="item" text="{{item.val}}" on-change="changed(item)"></umb-checkbox>
<umb-checkbox name="{{model.alias}}" value="{{item.key}}" model="item" text="{{item.val}}" on-change="changed(item)"></umb-checkbox>
</li>
</ul>