diff --git a/lib/mergely.js b/lib/mergely.js index 64f58e8..b611cdb 100644 --- a/lib/mergely.js +++ b/lib/mergely.js @@ -599,8 +599,14 @@ jQuery.extend(Mgly.mergely.prototype, { } jQuery('').appendTo('head'); this.bind(); - if (this.settings.lhs) this.settings.lhs( this.editor[this.id + '-lhs'].setValue ); - if (this.settings.rhs) this.settings.rhs( this.editor[this.id + '-rhs'].setValue ); + if (this.settings.lhs) { + var setv = this.editor[this.id + '-lhs'].getDoc().setValue; + this.settings.lhs(setv.bind(this.editor[this.id + '-lhs'].getDoc())); + } + if (this.settings.rhs) { + var setv = this.editor[this.id + '-rhs'].getDoc().setValue; + this.settings.rhs(setv.bind(this.editor[this.id + '-rhs'].getDoc())); + } // resize only after bind this.settings.resize();