Skip to content

Instantly share code, notes, and snippets.

@rix0rrr
rix0rrr / wysihtml5 ko binding handler
Created November 19, 2012 12:38 — forked from codescribler/wysihtml5 ko binding handler
A binding handler for binding knockout observables to a wysihtml5 editor
/**
* Correct version of a wysihtml5 binding for KnockoutJS that is safe for multiple inclusion on a single page
*/
ko.bindingHandlers.wysihtml5 = {
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var control = $(element).wysihtml5({
"events": {
"change" : function() {
var observable = valueAccessor();
observable(control.getValue());