Skip to content

Commit

Permalink
Fixed test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pmk65 committed Dec 12, 2019
1 parent 450a57c commit 8ed94b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/editors/colorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ import { StringEditor } from './string'
import { $extend } from '../utilities'

export var ColorEditor = StringEditor.extend({
postBuild: function () {
if (window.Picker) this.input.type = 'text'
},
setValue: function (value, initial, fromTemplate) {
var res = this._super(value, initial, fromTemplate)
if (this.picker_instance && this.picker_instance.domElement && res && res.changed) {
this.picker_instance.setColor(res.value, true)
}
return res
},
getNumColumns: function () {
return 2
},
afterInputReady: function () {
this._super()
this.createPicker(true)
Expand Down Expand Up @@ -70,7 +76,6 @@ export var ColorEditor = StringEditor.extend({
if (!options.popup && typeof options.onChange !== 'function') options.onChange = updateHandler
else if (options.popup && typeof options.onDone !== 'function') options.onDone = updateHandler

this.input.type = 'text'
this.picker_instance = new window.Picker(options)
// this.picker_instance.openHandler()
if (!options.popup) { // use inline colorPicker
Expand Down
2 changes: 1 addition & 1 deletion tests/pages/colorpicker-use-vanilla-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"colorpicker": {
"type": "string",
"format": "color",
"default": "#000000",
"default": "rgba(0,0,0,1)",
"options": {
"colorpicker": {
"alpha": true,
Expand Down

0 comments on commit 8ed94b2

Please sign in to comment.