diff --git a/addon/colorpicker/colorview.js b/addon/colorpicker/colorview.js index e83fcc7..82ed53b 100644 --- a/addon/colorpicker/colorview.js +++ b/addon/colorpicker/colorview.js @@ -50,7 +50,10 @@ cm.state.colorpicker.init_color_update(); cm.state.colorpicker.style_color_update(); } + } + function onRefresh(cm, evt) { + onChange(cm, { origin : 'setValue'}); } function onKeyup(cm) { @@ -117,6 +120,7 @@ this.cm.on('keyup', onKeyup); this.cm.on('change', onChange); this.cm.on('update', onUpdate); + this.cm.on('refresh', onRefresh); // create paste callback this.onPasteCallback = (function (cm, callback) { diff --git a/sample/colorpicker.html b/sample/colorpicker.html index 259b724..3feee7e 100644 --- a/sample/colorpicker.html +++ b/sample/colorpicker.html @@ -178,7 +178,9 @@ } }); - cm.refresh(); + setTimeout(function(){ + cm.refresh(); + }, 100);