Commit f9e0a6da authored by Fatih Acet's avatar Fatih Acet

Dynamically highlight code blocks in merge conflicts widgets.

parent 1def3510
...@@ -46,14 +46,19 @@ window.MergeConflictResolver = class MergeConflictResolver { ...@@ -46,14 +46,19 @@ window.MergeConflictResolver = class MergeConflictResolver {
const dp = this.dataProvider; const dp = this.dataProvider;
$.get('./conflicts.json') $.get('./conflicts.json')
.done( (data) => { .done((data) => {
dp.decorateData(this.vue, data); dp.decorateData(this.vue, data);
}) })
.error( (data) => { .error((data) => {
dp.handleFailedRequest(this.vue, data); dp.handleFailedRequest(this.vue, data);
}) })
.always( () => { .always(() => {
this.vue.isLoading = false; this.vue.isLoading = false;
this.vue.$nextTick(() => {
$('#conflicts .js-syntax-highlight').syntaxHighlight();
});
if (this.vue.diffViewType === 'parallel') { if (this.vue.diffViewType === 'parallel') {
$('.content-wrapper .container-fluid').removeClass('container-limited'); $('.content-wrapper .container-fluid').removeClass('container-limited');
} }
...@@ -65,7 +70,7 @@ window.MergeConflictResolver = class MergeConflictResolver { ...@@ -65,7 +70,7 @@ window.MergeConflictResolver = class MergeConflictResolver {
this.vue.isSubmitting = true; this.vue.isSubmitting = true;
$.post('./resolve_conflicts', this.dataProvider.getCommitData()) $.post('./resolve_conflicts', this.dataProvider.getCommitData())
.done( (data) => { .done((data) => {
window.location.href = data.redirect_to; window.location.href = data.redirect_to;
}) })
.error(() => { .error(() => {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
%a.btn.view-file.btn-file-option{":href" => "file.blobPath"} %a.btn.view-file.btn-file-option{":href" => "file.blobPath"}
View file @{{conflictsData.shortCommitSha}} View file @{{conflictsData.shortCommitSha}}
.diff-content.diff-wrap-lines .diff-content.diff-wrap-lines
.diff-wrap-lines.code.file-content.js-syntax-highlight.white .diff-wrap-lines.code.file-content.js-syntax-highlight
%table %table
%tr.line_holder.parallel{"v-for" => "section in file.parallelLines"} %tr.line_holder.parallel{"v-for" => "section in file.parallelLines"}
%template{"v-for" => "line in section"} %template{"v-for" => "line in section"}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment