Mercurial > hg
diff mercurial/templates/static/mercurial.js @ 35255:ad0de63e1d6a
hgweb: move common vertex code to Graph.prototype
Just to give some context to the return values: vertex() needs to return two
HTML elements as strings, <li> to be used as a background and a <li> to be
shown in foreground. The latter was made obsolete recently when changesets
started to be rendered server-side, but background elements are still useful
for now.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 06 Dec 2017 12:10:16 +0800 |
parents | 9c99541e3d56 |
children | 27ab3150cd50 |
line wrap: on
line diff
--- a/mercurial/templates/static/mercurial.js Wed Dec 06 12:01:07 2017 +0800 +++ b/mercurial/templates/static/mercurial.js Wed Dec 06 12:10:16 2017 +0800 @@ -92,6 +92,21 @@ }, + vertex: function(x, y, radius, color, parity, cur) { + this.ctx.beginPath(); + this.setColor(color, 0.25, 0.75); + this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); + this.ctx.fill(); + + var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size; + var item = document.querySelector('[data-node="' + cur.node + '"]'); + if (item) { + item.style.paddingLeft = left + 'px'; + } + + return ['', '']; + }, + render: function(data) { var backgrounds = '';