diff --git a/CHANGELOG.md b/CHANGELOG.md
index a291ae73..e0192c41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,7 @@
## 1.14.4
- inspector
- - the color picker is no longer in a modal and now shows changes on the fly (the new color is not saved unless "confirm" is clicked)
+ - color picker: inline picker widget (no longer in a modal); show color changes on the fly
## 1.14.3
diff --git a/src/client/ui/ui-colorpicker.js b/src/client/ui/ui-colorpicker.js
index 677fe3d2..26d80242 100644
--- a/src/client/ui/ui-colorpicker.js
+++ b/src/client/ui/ui-colorpicker.js
@@ -30,27 +30,25 @@ class ColorPicker extends UiWidget {
this.container = html`
${this.rgb.container}
-
-
${locales('inspector_color_confirm')}
-
${locales('inspector_color_cancel')}
-
`
- DOM.get(this.container, '.color-confirm')[0].addEventListener('click', this.confirm.bind(this))
- DOM.get(this.container, '.color-cancel')[0].addEventListener('click', this.cancel.bind(this))
-
this.rgb.on('change', (e)=>{
e.stopPropagation = true
this.value = chroma(this.rgb.value).hex()
this.trigger('change', {preventHistory: true})
})
+
+ this.rgb.on('dragend', (e)=>{
+ this.value = chroma(this.rgb.value).hex()
+ this.trigger('change')
+ })
+
+
this.opened = 0
- this.cancelValue = '#00000000'
-
this.escKeyHandler = ((e)=>{
- if (e.keyCode==27) this.cancel()
+ if (e.keyCode==27) this.close()
}).bind(this)
this.enterKeyHandler = ((e)=>{
@@ -89,16 +87,6 @@ class ColorPicker extends UiWidget {
}
- cancel() {
-
- if (this.value !== this.cancelValue) {
- this.value = this.cancelValue
- this.trigger('change', {preventHistory: true})
- }
- this.close()
-
- }
-
isVisible() {
return true
@@ -119,12 +107,6 @@ class ColorPicker extends UiWidget {
}
- setCancelValue(v) {
-
- this.cancelValue = v
-
- }
-
setParent(node) {
if (this.opened && node !== this.parentNode) this.close()
diff --git a/src/client/ui/ui-inspector.js b/src/client/ui/ui-inspector.js
index 98bbf1e7..062e8439 100644
--- a/src/client/ui/ui-inspector.js
+++ b/src/client/ui/ui-inspector.js
@@ -68,13 +68,11 @@ class UiInspector extends UiWidget {
textarea = DOM.get(this.container, `textarea[name="${name}"]`)
if (this.colorPicker.name === name) {
- this.colorPicker.cancel()
+ this.colorPicker.close()
} else {
- if (this.colorPicker.opened) this.colorPicker.cancel()
this.colorPicker.setParent(node.parentNode)
this.colorPicker.setName(name)
this.colorPicker.setValue(node.getAttribute('value'))
- this.colorPicker.setCancelValue(textarea[0].value)
this.colorPicker.open()
}
diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss
index 9a544857..34489d98 100644
--- a/src/scss/ui/inspector.scss
+++ b/src/scss/ui/inspector.scss
@@ -638,28 +638,6 @@ osc-inspector-color {
}
}
- .actions {
- display: flex;
- flex-direction: row;
- align-items: flex-end;
- justify-content: stretch;
- // height: 24rem + $padding * 2;
- line-height: $field-height;
- flex-shrink: 0;
- background: var(--color-ui-foreground);
- // padding: $padding;
- .btn {
- flex: 1;
- text-overflow: clip;
- min-width: 0;
- background: var(--color-ui-button);
- margin-right: 1rem;
- &:last-child {
- margin: 0;
- }
- }
- }
-
}
.inspector-help {