hgweb: stop adding strings to innerHTML of #graphnodes and #nodebgs (BC)
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 05 Jan 2018 19:30:30 +0800
changeset 35537 8b958d21b19d
parent 35536 bb5a03dfd7ff
child 35538 b6ce3568771d
hgweb: stop adding strings to innerHTML of #graphnodes and #nodebgs (BC) There's nothing that uses this functionality anymore, since all HTML is generated server-side now. Changeset entries are still accessible in JS via DOM (that's how we set left padding), so it's still possible to do something unusual by overriding Graph.prototype.vertex().
mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Fri Jan 05 19:22:05 2018 +0800
+++ b/mercurial/templates/static/mercurial.js	Fri Jan 05 19:30:30 2018 +0800
@@ -40,7 +40,6 @@
 		this.bg = [0, 4];
 		this.cell = [2, 0];
 		this.columns = 0;
-		document.getElementById('nodebgs').innerHTML = '';
 	},
 
 	scale: function(height) {
@@ -102,14 +101,10 @@
 		if (item) {
 			item.style.paddingLeft = left + 'px';
 		}
-
-		return ['', ''];
 	},
 
 	render: function(data) {
 
-		var backgrounds = '';
-		var nodedata = '';
 		var i, j, cur, line, start, end, color, x, y, x0, y0, x1, y1, column, radius;
 
 		var cols = 0;
@@ -172,17 +167,12 @@
 			radius = this.box_size / 8;
 			x = this.cell[0] + this.box_size * column + this.box_size / 2;
 			y = this.bg[1] - this.bg_height / 2;
-			var add = this.vertex(x, y, radius, color, parity, cur);
-			backgrounds += add[0];
-			nodedata += add[1];
+			this.vertex(x, y, radius, color, parity, cur);
 
 			if (fold) this.columns -= 1;
 
 		}
 
-		document.getElementById('nodebgs').innerHTML += backgrounds;
-		document.getElementById('graphnodes').innerHTML += nodedata;
-
 	}
 
 };