Fixes: U4-4557 Color Picker - default is black, but it can't be added without choosing another color first
Sets color to be black by default, so will be added if you click add without setting anything, so its consistent with the default swatch
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiColorPickerController",
|
||||
function ($scope, $timeout, assetsService, angularHelper, $element) {
|
||||
//NOTE: We need to make each color an object, not just a string because you cannot 2-way bind to a primitive.
|
||||
|
||||
$scope.newColor = "";
|
||||
var defaultColor = "000000";
|
||||
|
||||
$scope.newColor = defaultColor;
|
||||
$scope.hasError = false;
|
||||
|
||||
assetsService.load([
|
||||
@@ -67,7 +68,7 @@
|
||||
});
|
||||
if (!exists) {
|
||||
$scope.model.value.push({ value: $scope.newColor });
|
||||
$scope.newColor = "";
|
||||
$scope.newColor = defaultColor;
|
||||
$scope.hasError = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user