From 696d2d92d1eeeeb8b861da3e05aa29c86c1bae38 Mon Sep 17 00:00:00 2001 From: Robin Schreiber Date: Mon, 3 Jun 2024 16:20:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B0:=20add=20support=20for=20embedded?= =?UTF-8?q?=20color=20picker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Useful in cases where the color picker is not used as a popup but for interactive essay examples. --- lively.ide/styling/color-picker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lively.ide/styling/color-picker.js b/lively.ide/styling/color-picker.js index 699d3863c9..2a0a0af757 100644 --- a/lively.ide/styling/color-picker.js +++ b/lively.ide/styling/color-picker.js @@ -219,6 +219,7 @@ export class ColorPickerModel extends ViewModel { static get properties () { return { isHaloItem: { defaultValue: true }, + embedded: { defaultValue: false }, colorMode: {}, context: { serialize: false, @@ -342,6 +343,7 @@ export class ColorPickerModel extends ViewModel { } close () { + if (this.embedded) return; // if embedded cannot be closed this.view.remove(); const { context } = this; if (context) context.withTopBarDo(topBar => topBar.setEditMode(topBar.view.recoverMode, true)); @@ -374,7 +376,7 @@ export class ColorPickerModel extends ViewModel { const isGradient = ['linearGradient', 'radialGradient'].includes(newMode); if (isGradient) noUpdate(() => this.context.halos().forEach(m => m.remove())); else { - if (this._target) { noUpdate(() => $world.showHaloFor(this._target)); } + if (!this.embedded && this._target) { noUpdate(() => $world.showHaloFor(this._target)); } } this.ui.gradientControl.toggle(isGradient, this); this.colorMode = newMode;