MCPcopy
hub / github.com/GrapesJS/grapesjs / updateOriginalInput

Function updateOriginalInput

packages/core/src/utils/ColorPicker.ts:902–921  ·  view source on GitHub ↗
(fireCallback)

Source from the content-addressed store, hash-verified

900 }
901
902 function updateOriginalInput(fireCallback) {
903 var color = get(),
904 displayColor = '',
905 hasChanged = isDefault ? true : !tinycolor.equals(color, colorOnShow);
906
907 if (color) {
908 displayColor = color.toString(currentPreferredFormat);
909 // Update the selection palette with the current color
910 !visible && addColorToSelectionPalette(color);
911 }
912
913 if (isInput) {
914 boundElement.val(displayColor);
915 }
916
917 if (fireCallback && hasChanged) {
918 callbacks.change(color);
919 boundElement.trigger('change', [color]);
920 }
921 }
922
923 function reflow() {
924 if (!visible) {

Callers 5

initializeFunction · 0.85
paletteElementClickFunction · 0.85
setFromTextInputFunction · 0.85
clickoutFunction · 0.85
spectrumFunction · 0.85

Calls 5

equalsMethod · 0.80
toStringMethod · 0.80
getFunction · 0.70
triggerMethod · 0.45

Tested by

no test coverage detected