From c4acf124b9898027032ed8169115abbebf4b4339 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 25 Oct 2019 14:40:22 +0200 Subject: [PATCH] Automatically select all languages when selecting a mandatory language in the listview unpublish dialog --- .../listview/overlays/listviewunpublish.controller.js | 11 +++++++++-- .../listview/overlays/listviewunpublish.html | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.controller.js index 46604227da..df97d67f5d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.controller.js @@ -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); } } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.html index d7f33db58b..f6ef22d554 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/overlays/listviewunpublish.html @@ -30,6 +30,7 @@ model="language.unpublish" on-change="vm.changeSelection(language)" text="{{language.name}}" + disabled="language.disabled" />