knockout-froala
Advanced tools
Comparing version 2.4.2 to 2.5.0
{ | ||
"name": "knockout-froala", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"homepage": "https://github.com/froala/knockout-froala", | ||
@@ -39,3 +39,3 @@ "authors": [ | ||
"dependencies": { | ||
"froala-wysiwyg-editor": "2.4.2", | ||
"froala-wysiwyg-editor": "2.5.0", | ||
"knockout": "~3.3.0", | ||
@@ -42,0 +42,0 @@ "jquery": "1.11.0" |
{ | ||
"name": "knockout-froala", | ||
"version": "2.4.2", | ||
"version": "2.5.0", | ||
"description": "Knockout.js binding for Froala WYSIWYG HTML Rich Text Editor", | ||
@@ -5,0 +5,0 @@ "main": "src/knockout-froala.js", |
@@ -36,12 +36,15 @@ /** | ||
// update underlying model whenever editor content changed | ||
$el.on('froalaEditor.contentChanged', function (e, editor) { | ||
if( ko.isWriteableObservable( model ) ) { | ||
var editorValue = editor.html.get(); | ||
var current = model(); | ||
if(current !== editorValue) { | ||
model( editorValue ); | ||
var processUpdateEvent = function (e, editor) { | ||
if (ko.isWriteableObservable(model)) { | ||
var editorValue = editor.html.get(); | ||
var current = model(); | ||
if (current !== editorValue) { | ||
model(editorValue); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
$el.on('froalaEditor.contentChanged', processUpdateEvent); | ||
$el.on('froalaEditor.paste.after', processUpdateEvent); | ||
// cleanup editor, when dom node is removed | ||
@@ -48,0 +51,0 @@ ko.utils.domNodeDisposal.addDisposeCallback( element, destroy( element ) ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13499
156