Socket
Socket
Sign inDemoInstall

ember-pickr

Package Overview
Dependencies
580
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

30

addon/components/color-picker.js
import Component from '@ember/component';
import layout from '../templates/components/color-picker';
import mergeDeep from "../utils/mergeDeep";
import { computed } from '@ember/object';
import { assert } from '@ember/debug';

@@ -82,3 +85,3 @@

let value = this.formatColor(hsva);
this.set('value', value);
this.set('_value', value);

@@ -97,6 +100,27 @@ if (this.onSave) {

this.set('value', this.formatColor(pickr.getColor()));
this.set('_value', this.formatColor(pickr.getColor()));
this._pickr = pickr;
},
},
value: computed('_value', {
get() {
return this.get('_value');
},
set(key, value) {
let pickr = this._pickr;
if (pickr) {
let currentColor = this.formatColor(pickr.getColor());
// This check is to avoid setting the same color twice one after another
// Without this check, this will result in two computations for every color change
if (currentColor !== value) {
this._pickr.setColor(value);
}
}
return value;
}
}),
formatColor(hsva) {

@@ -103,0 +127,0 @@ if (!hsva) {

2

package.json
{
"name": "ember-pickr",
"version": "1.0.1",
"version": "1.1.0",
"description": "Color Picker for EmberJS using pickr",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc