Browse Source
Merge pull request #749 from ryandeba/trait-color-bug-fix
set the initial trait color input value after the InputColor is created
pull/756/head
Artur Arseniev
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
src/trait_manager/view/TraitColorView.js
|
|
|
@ -10,16 +10,17 @@ module.exports = TraitView.extend({ |
|
|
|
getInputEl() { |
|
|
|
if (!this.$input) { |
|
|
|
var value = this.getModelValue(); |
|
|
|
var inputNumber = new InputColor({ |
|
|
|
var inputColor = new InputColor({ |
|
|
|
target: this.config.em, |
|
|
|
contClass: this.ppfx + 'field-color', |
|
|
|
model: this.model, |
|
|
|
ppfx: this.ppfx |
|
|
|
}); |
|
|
|
this.input = inputNumber.render(); |
|
|
|
this.input = inputColor.render(); |
|
|
|
this.$input = this.input.colorEl; |
|
|
|
value = value || ''; |
|
|
|
this.model.set('value', value).trigger('change:value'); |
|
|
|
this.input.setValue(value); |
|
|
|
} |
|
|
|
return this.$input.get(0); |
|
|
|
}, |
|
|
|
|