diff --git a/src/domain_abstract/ui/InputColor.js b/src/domain_abstract/ui/InputColor.js index 357d372e0..170c5e067 100644 --- a/src/domain_abstract/ui/InputColor.js +++ b/src/domain_abstract/ui/InputColor.js @@ -56,16 +56,16 @@ export default Input.extend({ */ getColorEl() { if (!this.colorEl) { + const { em } = this; const self = this; const ppfx = this.ppfx; var model = this.model; var colorEl = $(`
`); var cpStyle = colorEl.get(0).style; - var elToAppend = this.em && this.em.config ? this.em.config.el : ''; + var elToAppend = em && em.config ? em.config.el : ''; var colorPickerConfig = - (this.em && this.em.getConfig && this.em.getConfig('colorPicker')) || - {}; + (em && em.getConfig && em.getConfig('colorPicker')) || {}; const getColor = color => { let cl = color.getAlpha() == 1 ? color.toHexString() : color.toRgbString(); @@ -117,8 +117,9 @@ export default Input.extend({ } }); - this.em && - this.em.on('component:selected', () => { + em && + em.on && + em.on('component:selected', () => { changed = 1; colorEl.spectrum('hide'); });