1
0
mirror of synced 2025-11-06 04:30:40 +08:00

Current selected diff can now be styled from css.

This commit is contained in:
Jamie Peabody
2016-07-25 20:36:06 +01:00
parent 266e0c7818
commit f371fb9085

View File

@@ -677,7 +677,12 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
if (this.settings.rhs_margin != 'left') {
this.element.append(rmargin);
}
//codemirror
// get current diff border color
var color = $('<div style="display:none" class="mergely current start" />').appendTo('body').css('border-top-color');
this.current_diff_color = color;
// codemirror
var cmstyle = '#' + this.id + ' .CodeMirror-gutter-text { padding: 5px 0 0 0; }' +
'#' + this.id + ' .CodeMirror-lines pre, ' + '#' + this.id + ' .CodeMirror-gutter-text pre { line-height: 18px; }' +
'.CodeMirror-linewidget { overflow: hidden; };';
@@ -1487,9 +1492,9 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
for (var i = 0; i < changes.length; ++i) {
var change = changes[i];
var fill = this.settings.fgcolor[change['op']];
if (this._current_diff==i) {
fill = '#000';
}
if (this._current_diff === i) {
fill = this.current_diff_color;
}
this.trace('draw', change);
// margin indicators