diff --git a/app/docker/views/services/edit/includes/mounts.html b/app/docker/views/services/edit/includes/mounts.html index 49309e4d7..874c70d47 100644 --- a/app/docker/views/services/edit/includes/mounts.html +++ b/app/docker/views/services/edit/includes/mounts.html @@ -28,7 +28,7 @@ name="mountType" class="form-control" ng-model="mount.Type" - ng-change="updateMount(service, mount)" + ng-change="onChangeMountType(service, mount)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate" > diff --git a/app/docker/views/services/edit/serviceController.js b/app/docker/views/services/edit/serviceController.js index b0a4932a6..f72c05dbb 100644 --- a/app/docker/views/services/edit/serviceController.js +++ b/app/docker/views/services/edit/serviceController.js @@ -209,6 +209,12 @@ angular.module('portainer.docker').controller('ServiceController', [ updateServiceArray(service, 'ServiceMounts', service.ServiceMounts); } }; + + $scope.onChangeMountType = function onChangeMountType(service, mount) { + mount.Source = null; + $scope.updateMount(service, mount); + }; + $scope.updateMount = function updateMount(service) { updateServiceArray(service, 'ServiceMounts', service.ServiceMounts); };