1
0
mirror of synced 2025-12-07 14:24:32 +08:00

Fixed setting lhs/rhs using CodeMirror's setValue.

This commit is contained in:
Jamie Peabody
2013-03-03 22:45:56 +00:00
parent 274d85bf05
commit c382afa2a5

View File

@@ -599,8 +599,14 @@ jQuery.extend(Mgly.mergely.prototype, {
}
jQuery('<style type="text/css">' + cmstyle + '</style>').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();