From b10f1ebe0e00fdb9a3a57ef607a2caf84a8de056 Mon Sep 17 00:00:00 2001 From: Brian Ernesto Date: Tue, 12 Mar 2024 22:35:03 -0600 Subject: [PATCH] Update Spectrum palette to launch in the body instead of the editor This enables the palette to be displayed over any InputColor on the page. --- src/domain_abstract/ui/InputColor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain_abstract/ui/InputColor.ts b/src/domain_abstract/ui/InputColor.ts index 75b9ce8fc..c2917a8e1 100644 --- a/src/domain_abstract/ui/InputColor.ts +++ b/src/domain_abstract/ui/InputColor.ts @@ -103,7 +103,7 @@ export default class InputColor extends Input { var colorEl = $(`
`); var cpStyle = colorEl.get(0)!.style; - var elToAppend = em && em.config ? em.config.el : ''; + var elToAppend = $('body'); var colorPickerConfig = (em && em.getConfig && em.getConfig().colorPicker) || {}; this.movedColor = ''; @@ -123,7 +123,7 @@ export default class InputColor extends Input { // @ts-ignore colorEl.spectrum({ color: model.getValue() || false, - containerClassName: `${ppfx}one-bg ${ppfx}two-color`, + containerClassName: `${ppfx}one-bg ${ppfx}two-color ${ppfx}editor-sp`, appendTo: elToAppend || 'body', maxSelectionSize: 8, showPalette: true,