From 9cc99f4a24885d3dbf02429161001781be7296b8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 9 Apr 2020 02:07:21 +0200 Subject: [PATCH] Fix PropertyColorView tests --- src/domain_abstract/ui/InputColor.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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'); });