//console.log(loopIndex)
diffEditor.dataset.loaded = true
url.searchParams.append('ajax', '1')
url.searchParams.append('filename', diffEditor.dataset.filename)
const loader = $(`#p3x-gitlist-commit-diff-loader-${loopIndex}`)
const loaderAjax = $(`#p3x-gitlist-commit-diff-loader-ajax-${loopIndex}`)
const loaderWebworker = $(`#p3x-gitlist-commit-diff-loader-webworker-${loopIndex}`)
const scroller = $(`#p3x-gitlist-commit-diff-scroller-${loopIndex}`)
scroller.css('max-height', window.gitlist.editorMaxHeight)
$.ajax(url.toString()).then(function (diffsResponseJson) {
if (typeof diffsResponseJson !== 'object') {
const sendErrorMessage = `${window.gitlist.basepath}/json-error`;
console.log(sendErrorMessage);
$.redirect(sendErrorMessage, {
error: diffsResponseJson,
})
} else {
const diffs = diffsResponseJson[0];
loaderAjax.hide()
loaderWebworker.show()