gr-diff: make blame element clickable

Change-Id: I05be246e311f9a4a1a762bcf940471d3624c62c2
This commit is contained in:
Han-Wen Nienhuys
2019-12-05 19:01:51 +01:00
parent 6b92574bf2
commit 4cfb08a903
2 changed files with 6 additions and 0 deletions

View File

@@ -560,6 +560,10 @@
isStartOfRange ? 'startOfRange' : '');
const shaNode = this._createElement('span', 'sha');
shaNode.innerText = commit.id.substr(0, 7);
shaNode.onclick = function() {
location.href = '/q/' + shaNode.innerText;
};
blameNode.appendChild(shaNode);
blameNode.append(` on ${date} by ${commit.author}`);
return blameNode;

View File

@@ -273,6 +273,8 @@ limitations under the License.
}
td.blame .sha {
font-family: var(--monospace-font-family);
color: var(--link-color);
cursor: pointer;
}
.full-width td.blame {
overflow: hidden;