fix(issue-77): hides both sidebars when initializing with 'sidebar: false' (#81)

This commit is contained in:
Jamie Peabody
2018-05-26 12:48:15 -07:00
committed by GitHub
parent 157d763af6
commit d7a7ddcd55
2 changed files with 26 additions and 4 deletions

View File

@@ -691,9 +691,6 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
this.element.append(jQuery('<div style="position:relative;width:' + width + '; height:' + height + '" id="' + this.id + '-editor-lhs" class="mergely-column"><textarea style="" id="' + this.id + '-lhs"></textarea></div>'));
this.element.append(jQuery('<div class="mergely-canvas" style="height: ' + height + '"><canvas id="' + this.id + '-lhs-' + this.id + '-rhs-canvas" style="width:28px" width="28px" height="' + height + '"></canvas></div>'));
var rmargin = jQuery('<div class="mergely-margin" style="height: ' + height + '"><canvas id="' + this.id + '-rhs-margin" width="8px" height="' + height + '"></canvas></div>');
if (!this.settings.sidebar) {
this.element.find('.mergely-margin').css({display: 'none'});
}
if (this.settings.rhs_margin == 'left') {
this.element.append(rmargin);
}
@@ -701,6 +698,9 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
if (this.settings.rhs_margin != 'left') {
this.element.append(rmargin);
}
if (!this.settings.sidebar) {
this.element.find('.mergely-margin').css({display: 'none'});
}
if (['lgpl-separate-notice', 'gpl-separate-notice', 'mpl-separate-notice', 'commercial'].indexOf(this.settings.license) < 0) {
const _lic = {
'lgpl': 'GNU LGPL v3.0',