Skip to content

Commit

Permalink
Updates on color input
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Sep 20, 2017
1 parent 714ffcc commit 53b2ba0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/domain_abstract/ui/InputColor.js
Expand Up @@ -25,7 +25,7 @@ module.exports = Input.extend({
/**
* Updates the view when the model is changed
* */
handleModelChange() {
handleModelChange(mdl, vl, opts = {}) {
Input.prototype.handleModelChange.apply(this, arguments);

var value = this.model.get('value');
Expand All @@ -34,6 +34,12 @@ module.exports = Input.extend({
// If no color selected I will set white for the picker
value = value === 'none' ? '#fff' : value;
colorEl.get(0).style.backgroundColor = value;

// Prevent usuless palette updating
if (!opts.avoidStore) {
console.log('COlor to set', value, mdl, vl, opts);
colorEl.spectrum('set', value);
}
},

/**
Expand All @@ -59,6 +65,7 @@ module.exports = Input.extend({
let changed = 0;
let previousСolor;
colorEl.spectrum({
//color: "#f00"
appendTo: elToAppend || 'body',
maxSelectionSize: 8,
showPalette: true,
Expand Down

0 comments on commit 53b2ba0

Please sign in to comment.