Automatically select all languages when selecting a mandatory language in the listview unpublish dialog

This commit is contained in:
Kenn Jacobsen
2019-10-25 14:40:22 +02:00
committed by Sebastiaan Janssen
parent 9d91402aca
commit c4acf124b9
2 changed files with 10 additions and 2 deletions

View File

@@ -17,8 +17,14 @@
$scope.model.disableSubmitButton = !firstSelected;
//need to set the Save state to true if publish is true
language.save = language.unpublish;
if (language.isMandatory) {
angular.forEach($scope.model.languages, function (lang) {
if (lang !== language) {
lang.unpublish = true;
lang.disabled = language.unpublish;
}
});
}
}
function onInit() {
@@ -50,6 +56,7 @@
if (active) {
//ensure that the current one is selected
active.unpublish = true;
changeSelection(active);
}
}

View File

@@ -30,6 +30,7 @@
model="language.unpublish"
on-change="vm.changeSelection(language)"
text="{{language.name}}"
disabled="language.disabled"
/>
<div>