align the use of input name attribute for checkboxes and radiobuttons
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user