Fixes #3993 Recent changes in color picker has caused incompatibility with existing picker

This commit is contained in:
Sebastiaan Janssen
2019-01-09 10:50:27 +01:00
parent a16e31c671
commit ec60ba142a

View File

@@ -123,6 +123,11 @@ 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;