mirror of
https://github.com/wickedest/Mergely.git
synced 2026-03-24 09:48:39 +08:00
Added query params settings to editor
This commit is contained in:
@@ -385,6 +385,8 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
autoupdate: true,
|
||||
autoresize: true,
|
||||
rhs_margin: 'right',
|
||||
wrap_lines: false,
|
||||
line_numbers: true,
|
||||
lcs: true,
|
||||
sidebar: true,
|
||||
viewport: false,
|
||||
@@ -441,8 +443,8 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
var cmsettings = {
|
||||
mode: 'text/plain',
|
||||
readOnly: false,
|
||||
lineWrapping: false,
|
||||
lineNumbers: true,
|
||||
lineWrapping: this.settings.wrap_lines,
|
||||
lineNumbers: this.settings.line_numbers,
|
||||
gutters: ['merge', 'CodeMirror-linenumbers']
|
||||
};
|
||||
this.lhs_cmsettings = {};
|
||||
@@ -543,6 +545,23 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
jQuery(this.element).find('.mergely-margin').css({display: 'none'});
|
||||
}
|
||||
}
|
||||
var le, re;
|
||||
if (this.settings.hasOwnProperty('wrap_lines')) {
|
||||
if (this.editor) {
|
||||
le = this.editor[this.id + '-lhs'];
|
||||
re = this.editor[this.id + '-rhs'];
|
||||
le.setOption('lineWrapping', this.settings.wrap_lines);
|
||||
re.setOption('lineWrapping', this.settings.wrap_lines);
|
||||
}
|
||||
}
|
||||
if (this.settings.hasOwnProperty('line_numbers')) {
|
||||
if (this.editor) {
|
||||
le = this.editor[this.id + '-lhs'];
|
||||
re = this.editor[this.id + '-rhs'];
|
||||
le.setOption('lineNumbers', this.settings.line_numbers);
|
||||
re.setOption('lineNumbers', this.settings.line_numbers);
|
||||
}
|
||||
}
|
||||
},
|
||||
options: function(opts) {
|
||||
if (opts) {
|
||||
|
||||
Reference in New Issue
Block a user