diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -165,12 +165,11 @@ msg.style.cursor = 's-resize'; msg.onclick = function() { this.parentNode.parentNode.style.height = 'auto'; - repaint_graph(); } } } - function set_canvas(max_w) { + function set_canvas(heads) { var c = document.getElementById('graph_nodes'); var t = document.getElementById('graph_content'); canvas = document.getElementById('graph_canvas'); @@ -180,25 +179,22 @@ c.style.height=max_w+'px'; canvas.setAttribute('width',max_w); }; - function calc_max_w(jsdata) { - var heads = 1; - var max_heads = 0; - for( var i=0;imax_heads){ - max_heads = m; - } - } - return Math.max(100,max_heads*25); + var heads = 1; + var max_heads = 0; + var jsdata = ${c.jsdata|n}; + + for( var i=0;imax_heads){ + max_heads = m; + } } - function repaint_graph() { - var jsdata = ${c.jsdata|n}; - var max_w = calc_max_w(jsdata); - set_canvas(max_w); - var r = new BranchRenderer(); - r.render(jsdata,max_w); - } - repaint_graph (); + var max_w = Math.max(100,max_heads*25); + set_canvas(max_w); + + var r = new BranchRenderer(); + r.render(jsdata,max_w); + }); %else: