Add clickable git diff data if indexer has it

This commit is contained in:
Matt Pass
2019-10-06 12:21:12 +01:00
committed by GitHub
parent 648ab7347f
commit bedf83b92f

View File

@@ -159,6 +159,21 @@ var ICEcoder = {
if (data.timestamps.changed) {
top.ICEcoder.indexData = data;
}
// If we have git diff data
if (data.git) {
top.ICEcoder.indexData.git = data.git;
var gitContent = "";
for (var i=0; i<top.ICEcoder.indexData.git.paths.length; i++) {
gitContent +=
'<div style="font-family: monospace" onclick="top.ICEcoder.openFile(\'/' +
top.ICEcoder.indexData.git.paths[i] +
"')\">" +
top.ICEcoder.indexData.git.paths[i] +
"</div>" +
"\n";
top.get("git").innerHTML = gitContent;
}
}
top.ICEcoder.indexing = false;
});
}