V8: Improve notifications save button style and interaction (#5097)

This commit is contained in:
Kenn Jacobsen
2019-04-23 15:59:57 +02:00
committed by Sebastiaan Janssen
parent fdfcb75a71
commit aba409600b
2 changed files with 8 additions and 6 deletions

View File

@@ -3,13 +3,12 @@
$scope,
contentResource,
navigationService,
angularHelper,
localizationService) {
var vm = this;
var currentForm;
vm.notifyOptions = [];
vm.save = save;
vm.cancel = cancel;
vm.notificationChanged = notificationChanged;
vm.message = {
name: $scope.currentNode.name
};
@@ -17,7 +16,6 @@
function onInit() {
vm.loading = true;
contentResource.getNotifySettingsById($scope.currentNode.id).then(function (options) {
currentForm = angularHelper.getCurrentForm($scope);
vm.loading = false;
vm.notifyOptions = options;
});
@@ -47,7 +45,10 @@
vm.saveError = error;
});
}
function notificationChanged(item) {
vm.canSave = true;
}
onInit();
}
angular.module("umbraco").controller("Umbraco.Editors.Content.CreateNotifyController", CreateNotifyController);
}());
}());

View File

@@ -21,7 +21,7 @@
<div class="block-form" ng-show="!vm.loading">
<span ng-bind-html="vm.labels.headline"></span>
<umb-control-group>
<umb-toggle-group items="vm.notifyOptions"></umb-toggle-group>
<umb-toggle-group items="vm.notifyOptions" on-click="vm.notificationChanged(item)"></umb-toggle-group>
</umb-control-group>
</div>
</div>
@@ -38,7 +38,8 @@
type="button"
action="vm.save(vm.notifyOptions)"
state="vm.saveState"
button-style="action">
button-style="success"
disabled="!vm.canSave">
</umb-button>
</div>
</div>