diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/readonlyvalue/readonlyvalue.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/readonlyvalue/readonlyvalue.controller.js index 48ec95ba0e..a49ffeadaa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/readonlyvalue/readonlyvalue.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/readonlyvalue/readonlyvalue.controller.js @@ -14,13 +14,7 @@ function ReadOnlyValueController($rootScope, $scope, $filter) { function formatDisplayValue() { - - if ($scope.model.config && - angular.isArray($scope.model.config) && - $scope.model.config.length > 0 && - $scope.model.config[0] && - $scope.model.config.filter) { - + if ($scope.model.config && $scope.model.config.filter) { if ($scope.model.config.format) { $scope.displayvalue = $filter($scope.model.config.filter)($scope.model.value, $scope.model.config.format); } else { @@ -29,12 +23,11 @@ function ReadOnlyValueController($rootScope, $scope, $filter) { } else { $scope.displayvalue = $scope.model.value; } - } //format the display value on init: formatDisplayValue(); - + $scope.$watch("model.value", function (newVal, oldVal) { //cannot just check for !newVal because it might be an empty string which we //want to look for. @@ -45,4 +38,4 @@ function ReadOnlyValueController($rootScope, $scope, $filter) { }); } -angular.module('umbraco').controller("Umbraco.PropertyEditors.ReadOnlyValueController", ReadOnlyValueController); \ No newline at end of file +angular.module('umbraco').controller("Umbraco.PropertyEditors.ReadOnlyValueController", ReadOnlyValueController);