auto focus mandatory checkbox when editor picker overlay closes

This commit is contained in:
Mads Rasmussen
2015-09-22 20:47:29 +02:00
parent 781c3007e6
commit 1d3b18b964
2 changed files with 10 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
vm.showValidationPattern = false;
vm.focusOnPatternField = false;
vm.focusOnMandatoryField = false;
vm.selectedValidationType = {};
vm.validationTypes = [
{
@@ -61,6 +62,8 @@
function openEditorPickerOverlay(property) {
vm.focusOnMandatoryField = false;
vm.editorPickerOverlay = {};
vm.editorPickerOverlay.title = "Choose editor";
vm.editorPickerOverlay.property = $scope.model.property;
@@ -72,6 +75,8 @@
$scope.model.updateSameDataTypes = model.updateSameDataTypes;
vm.focusOnMandatoryField = true;
// update property
property.config = model.property.config;
property.editor = model.property.editor;
@@ -93,6 +98,8 @@
function openEditorSettingsOverlay(property) {
vm.focusOnMandatoryField = false;
// get data type
dataTypeResource.getById(property.dataTypeId).then(function(dataType) {
@@ -121,6 +128,8 @@
// set flag to update same data types
$scope.model.updateSameDataTypes = true;
vm.focusOnMandatoryField = true;
vm.editorSettingsOverlay.show = false;
vm.editorSettingsOverlay = null;

View File

@@ -59,7 +59,7 @@
<div class="umb-control-group clearfix">
<label class="checkbox no-indent">
<input type="checkbox" ng-model="model.property.validation.mandatory"> Field is mandatory
<input type="checkbox" ng-model="model.property.validation.mandatory" focus-when="{{vm.focusOnMandatoryField}}"> Field is mandatory
</label>
<select class="umb-dropdown" ng-options="validationType.name for validationType in vm.validationTypes" ng-model="vm.selectedValidationType" ng-change="vm.changeValidationType(vm.selectedValidationType)">