Skip to content

Commit

Permalink
support update, refresh event
Browse files Browse the repository at this point in the history
  • Loading branch information
easylogic committed Apr 7, 2017
1 parent 4c21381 commit 9340ed3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions addon/colorpicker/colorview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion sample/colorpicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@
}
});

cm.refresh();
setTimeout(function(){
cm.refresh();
}, 100);

</script>
</body>
Expand Down

0 comments on commit 9340ed3

Please sign in to comment.