diff --git a/src/Umbraco.Web.UI/umbraco_client/GenericProperty/genericProperty.js b/src/Umbraco.Web.UI/umbraco_client/GenericProperty/genericProperty.js index 780793f762..cb71b3d0bd 100644 --- a/src/Umbraco.Web.UI/umbraco_client/GenericProperty/genericProperty.js +++ b/src/Umbraco.Web.UI/umbraco_client/GenericProperty/genericProperty.js @@ -13,13 +13,14 @@ function expandCollapse(theId) { } } function duplicatePropertyNameAsSafeAlias(nameId, aliasId) { - var input = $('#' + aliasId); - - $('#' + nameId).keyup(function(event) { - var value = $(this).val(); - getSafeAlias(aliasId, value, false, function (alias) { - input.val(alias); + var inputName = $('#' + nameId); + var inputAlias = $('#' + aliasId); + inputName.on('input', function (event) { + getSafeAlias(inputAlias, inputName.val(), false, function (alias) { + inputAlias.val(alias); }); + }).on('blur', function (event) { + $(this).off('input'); }); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs index 9138a470e8..0e4b20c268 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -834,7 +834,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }}); GenericProperty gpData = gp.GenricPropertyControl; if (string.IsNullOrEmpty(gpData.Name.Trim()) == false && string.IsNullOrEmpty(gpData.Alias.Trim()) == false) { - var propertyTypeAlias = Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim()); + var propertyTypeAlias = gpData.Alias.ToSafeAlias(); if (contentTypeItem.PropertyTypeExists(propertyTypeAlias) == false) { //Find the DataTypeDefinition that the PropertyType should be based on @@ -891,7 +891,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }}); var propertyType = contentTypeItem.PropertyTypes.First(x => x.Alias == gpw.PropertyType.Alias); if (propertyType == null) continue; var dataTypeDefinition = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(gpw.GenricPropertyControl.Type); - propertyType.Alias = gpw.GenricPropertyControl.Alias; + propertyType.Alias = gpw.GenricPropertyControl.Alias.ToSafeAlias(); propertyType.Name = gpw.GenricPropertyControl.Name; propertyType.Description = gpw.GenricPropertyControl.Description; propertyType.ValidationRegExp = gpw.GenricPropertyControl.Validation;