Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-content-editable

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-content-editable - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

26

addon/components/content-editable.js

@@ -8,2 +8,3 @@ import Ember from 'ember';

contenteditable: true,
isText: false,

@@ -14,4 +15,8 @@ setup: Ember.on('didInsertElement', function() {

_observeValue: true,
valueChanged: Ember.observer('value', function() {
this.setValue();
console.log("Value changed triggered");
if (this.get('_observeValue')) {
this.setValue();
}
}),

@@ -28,3 +33,20 @@

updateValue: Ember.on('keyUp', function(event) {
this.set('value', this.stringInterpolator(this.$().text()));
this.set('_observeValue', false);
let val;
if (this.get('isText')) {
val = this.element.innerText || this.element.textContent;
} else {
val = this.$().html();
}
val = this.stringInterpolator(val);
if (!this.get('isText')) {
val = Ember.String.htmlSafe(val);
}
this.set('value', val);
this.set('_observeValue', true);
this.handleKeyUp(event);

@@ -31,0 +53,0 @@ }),

2

package.json
{
"name": "ember-content-editable",
"version": "0.2.4",
"version": "0.3.0",
"description": "A content-editable component for ember-cli that just works.",

@@ -5,0 +5,0 @@ "directories": {

@@ -29,2 +29,13 @@ [![npm version](https://badge.fury.io/js/ember-content-editable.svg)](http://badge.fury.io/js/ember-content-editable)

### Options
Option Name | Description | Default
---------------------|------------------------------------------------|---------
value | The value to be edited | `""`
placeholder | Placeholder displayed when value is blank | `""`
isText | Is the value HTML or plaintext? | `true`
stringInterpolator | Function which processes any updated value. | `none`
| Takes a string and returns a string. |
extraClass | String with any extra css class. | `null`
### Events

@@ -31,0 +42,0 @@ You can also provide actions to handle the following events

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc