Mercurial > kallithea
comparison rhodecode/templates/changelog/changelog.html @ 1429:864e4daef963 beta
improved rendering of dag (they are not trimmed anymore when number of heads exceeds 5)
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 16 Jul 2011 12:33:40 +0200 |
parents | 5a96551ee9c0 |
children | d5d7c40e8591 |
comparison
equal
deleted
inserted
replaced
1428:e5467730682b | 1429:864e4daef963 |
---|---|
137 YUD.setStyle('rev_range_container','display','none'); | 137 YUD.setStyle('rev_range_container','display','none'); |
138 | 138 |
139 } | 139 } |
140 }); | 140 }); |
141 | 141 |
142 function set_canvas() { | 142 function set_canvas(heads) { |
143 var c = document.getElementById('graph_nodes'); | 143 var c = document.getElementById('graph_nodes'); |
144 var t = document.getElementById('graph_content'); | 144 var t = document.getElementById('graph_content'); |
145 canvas = document.getElementById('graph_canvas'); | 145 canvas = document.getElementById('graph_canvas'); |
146 var div_h = t.clientHeight; | 146 var div_h = t.clientHeight; |
147 c.style.height=div_h+'px'; | 147 c.style.height=div_h+'px'; |
148 canvas.setAttribute('height',div_h); | 148 canvas.setAttribute('height',div_h); |
149 canvas.setAttribute('width',160); | 149 c.style.height=max_w+'px'; |
150 canvas.setAttribute('width',max_w); | |
150 }; | 151 }; |
151 set_canvas(); | 152 var heads = 1; |
153 var max_heads = 0; | |
152 var jsdata = ${c.jsdata|n}; | 154 var jsdata = ${c.jsdata|n}; |
155 | |
156 for( var i=0;i<jsdata.length;i++){ | |
157 var m = Math.max.apply(Math, jsdata[i][1]); | |
158 if (m>max_heads){ | |
159 max_heads = m; | |
160 } | |
161 } | |
162 var max_w = Math.max(100,max_heads*25); | |
163 set_canvas(max_w); | |
164 | |
153 var r = new BranchRenderer(); | 165 var r = new BranchRenderer(); |
154 r.render(jsdata); | 166 r.render(jsdata,max_w); |
155 | |
156 | |
157 | 167 |
158 }); | 168 }); |
159 </script> | 169 </script> |
160 %else: | 170 %else: |
161 ${_('There are no changes yet')} | 171 ${_('There are no changes yet')} |