Skip to content

Commit

Permalink
Merge pull request #1 from astronomersiva/handle-clear
Browse files Browse the repository at this point in the history
Handle clear action in pickr
  • Loading branch information
astronomersiva authored Jan 7, 2019
2 parents c3425e0 + 8f5f869 commit 6d139b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions addon/components/color-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export default Component.extend({
},

formatColor(hsva) {
if (!hsva) {
return null;
}

let value = hsva;
let format = this.get('format');
if (format) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-pickr",
"version": "1.0.0",
"version": "1.0.1",
"description": "Color Picker for EmberJS using pickr",
"keywords": [
"ember-addon"
Expand Down
4 changes: 3 additions & 1 deletion tests/dummy/app/controllers/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export default Controller.extend({

actions: {
handleOnSave(hsva) {
window.alert(`You chose ${hsva.toHEX().toString()}!`);
if (hsva) {
window.alert(`You chose ${hsva.toHEX().toString()}!`);
}
},

handleOnChange(hsva) {
Expand Down

0 comments on commit 6d139b8

Please sign in to comment.