From d69f0fe9ddf8c8d37f4fe4d27b5974cddf4f88d3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 10 Jan 2019 15:35:48 +0100 Subject: [PATCH] #3993 Move color picker fix to correct method and update backwards compatibility test --- .../colorpicker/colorpicker.controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js index 3a6ddc5cfd..9b3be511a4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/colorpicker/colorpicker.controller.js @@ -123,11 +123,6 @@ function ColorPickerController($scope) { if (!$scope.model.value) return false; - // Backwards compatibility, the color used to be stored as a hex value only - if ($scope.model.value.length === 6) { - $scope.model.value = { value: $scope.model.value, label: $scope.model.value }; - } - // Complex color (value and label)? if (!$scope.model.value.hasOwnProperty("value")) return $scope.model.value === color.value; @@ -144,6 +139,11 @@ function ColorPickerController($scope) { if (!$scope.model.value) return; + // Backwards compatibility, the color used to be stored as a hex value only + if (typeof $scope.model.value === "string") { + $scope.model.value = { value: $scope.model.value, label: $scope.model.value }; + } + // Complex color (value and label)? if (!$scope.model.value.hasOwnProperty("value")) return;