From 3de58ee0196358d353e0d797d407aeb3e0ef383c Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 13 Sep 2021 14:47:49 -0400 Subject: fixed transparency for colorButtons --- src/client/views/nodes/button/FontIconBox.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx index 5ae7c3628..40d5ad819 100644 --- a/src/client/views/nodes/button/FontIconBox.tsx +++ b/src/client/views/nodes/button/FontIconBox.tsx @@ -26,12 +26,10 @@ import { SetActiveInkColor, ActiveFillColor, SetActiveFillColor, ActiveInkWidth, import { StyleProp } from '../../StyleProvider'; import { FieldView, FieldViewProps } from '.././FieldView'; import { RichTextMenu } from '../formattedText/RichTextMenu'; -import { TextButton } from './textButton'; -import { ToggleButton } from './toggleButton'; +import { Utils } from '../../../../Utils'; import { IButtonProps } from './ButtonInterface'; import { FontIconBadge } from './FontIconBadge'; import './FontIconBox.scss'; -import { undo } from 'prosemirror-history'; import { WebBox } from '../WebBox'; const FontIconSchema = createSchema({ icon: "string", @@ -333,15 +331,14 @@ export class FontIconBox extends DocComponent(Fon const scriptCheck: string = script + "(undefined, true)"; const boolResult = ScriptField.MakeScript(scriptCheck)?.script.run().result; - const showAlpha: boolean = script !== "setStrokeColor"; // bcz: ugh this should be changed to a field property on the button - const colorOptions: string[] = ['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF', '#f1efeb', "transparent"]; const colorBox = (func: (color: ColorState) => void) => ; const label = !this.label || !Doc.UserDoc()._showLabel ? (null) :
@@ -356,7 +353,7 @@ export class FontIconBox extends DocComponent(Fon const click = (value: ColorState) => { const hex: string = value.hex; - const s = ScriptField.MakeScript(script + '("' + hex + '", false)'); + const s = ScriptField.MakeScript(script + '("' + Utils.colorString(value) + '", false)'); if (s) { undoBatch(() => s.script.run().result)(); } -- cgit v1.2.3-70-g09d2