#3993 Move color picker fix to correct method and update backwards compatibility test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user