diff --git a/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs b/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs index be9c4880ce..60ef70e4b8 100644 --- a/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/LegacyParameterEditorAliasConverter.cs @@ -94,6 +94,12 @@ namespace Umbraco.Core.PropertyEditors CreateMap("textMultiLine", Constants.PropertyEditors.TextboxMultipleAlias); CreateMap("text", Constants.PropertyEditors.TextboxAlias); CreateMap("bool", Constants.PropertyEditors.TrueFalseAlias); + + CreateMap("mediaCurrent", Constants.PropertyEditors.MediaPickerAlias); + + CreateMap("number", Constants.PropertyEditors.IntegerAlias); + + } } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/fixnumber.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/fixnumber.directive.js index 8ea0b31b31..c177a60ec3 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/fixnumber.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/fixnumber.directive.js @@ -31,6 +31,13 @@ function fixNumber() { } } + ngModel.$formatters.push(function (value) { + if (angular.isString(value)) { + return parseFloat(value); + } + return value; + }); + //This fixes this angular issue: //https://github.com/angular/angular.js/issues/2144 // which doesn't actually validate the number input properly since the model only changes when a real number is entered diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html index 41d4cd17c7..be129bf859 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html @@ -29,9 +29,11 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html index ad5ac2d6e1..13cd4505d7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/integer/integer.html @@ -1,9 +1,10 @@ -
- + - - Invalid integer value + val-server="value" + fix-number /> + + Not a number {{propertyForm.requiredField.errorMsg}} -
+ + \ No newline at end of file diff --git a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs index 82dddff9a9..81d91ef10a 100644 --- a/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/IntegerPropertyEditor.cs @@ -3,7 +3,7 @@ using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { - [PropertyEditor(Constants.PropertyEditors.IntegerAlias, "Numeric", "integer")] + [PropertyEditor(Constants.PropertyEditors.IntegerAlias, "Numeric", "integer", IsParameterEditor = true)] public class IntegerPropertyEditor : PropertyEditor { ///