Browse Source
Merge pull request #3670 from HCL-TECH-SOFTWARE/issue-3614 - Fixes #3614
BUG:3614 detect default value and handle change
pull/3692/head
Artur Arseniev
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
src/utils/ColorPicker.js
|
|
@ -209,6 +209,7 @@ export default function($, undefined) { |
|
|
resize = throttle(reflow, 10), |
|
|
resize = throttle(reflow, 10), |
|
|
visible = false, |
|
|
visible = false, |
|
|
isDragging = false, |
|
|
isDragging = false, |
|
|
|
|
|
isDefault = true, |
|
|
dragWidth = 0, |
|
|
dragWidth = 0, |
|
|
dragHeight = 0, |
|
|
dragHeight = 0, |
|
|
dragHelperHeight = 0, |
|
|
dragHelperHeight = 0, |
|
|
@ -784,6 +785,7 @@ export default function($, undefined) { |
|
|
isEmpty = true; |
|
|
isEmpty = true; |
|
|
} else { |
|
|
} else { |
|
|
isEmpty = false; |
|
|
isEmpty = false; |
|
|
|
|
|
isDefault = !color; // if no color is available an empty string will be passed. tinycolor will then set it to #000
|
|
|
newColor = tinycolor(color); |
|
|
newColor = tinycolor(color); |
|
|
newHsv = newColor.toHsv(); |
|
|
newHsv = newColor.toHsv(); |
|
|
|
|
|
|
|
|
@ -958,7 +960,7 @@ export default function($, undefined) { |
|
|
function updateOriginalInput(fireCallback) { |
|
|
function updateOriginalInput(fireCallback) { |
|
|
var color = get(), |
|
|
var color = get(), |
|
|
displayColor = '', |
|
|
displayColor = '', |
|
|
hasChanged = !tinycolor.equals(color, colorOnShow); |
|
|
hasChanged = isDefault ? true : !tinycolor.equals(color, colorOnShow); |
|
|
|
|
|
|
|
|
if (color) { |
|
|
if (color) { |
|
|
displayColor = color.toString(currentPreferredFormat); |
|
|
displayColor = color.toString(currentPreferredFormat); |
|
|
|