Show More
@@ -362,7 +362,7 b' function asynchtml(url, $target, success' | |||||
362 | } |
|
362 | } | |
363 | $target.html(_TM['Loading ...']).css('opacity','0.3'); |
|
363 | $target.html(_TM['Loading ...']).css('opacity','0.3'); | |
364 |
|
364 | |||
365 | $.ajax({url: url, data: args, headers: {'X-PARTIAL-XHR': '1'}, cache: false, dataType: 'html'}) |
|
365 | return $.ajax({url: url, data: args, headers: {'X-PARTIAL-XHR': '1'}, cache: false, dataType: 'html'}) | |
366 | .done(function(html) { |
|
366 | .done(function(html) { | |
367 | $target.html(html); |
|
367 | $target.html(html); | |
368 | $target.css('opacity','1.0'); |
|
368 | $target.css('opacity','1.0'); | |
@@ -372,6 +372,8 b' function asynchtml(url, $target, success' | |||||
372 | } |
|
372 | } | |
373 | }) |
|
373 | }) | |
374 | .fail(function(jqXHR, textStatus, errorThrown) { |
|
374 | .fail(function(jqXHR, textStatus, errorThrown) { | |
|
375 | if (textStatus == "abort") | |||
|
376 | return; | |||
375 | console.log('Ajax failure: ' + textStatus); |
|
377 | console.log('Ajax failure: ' + textStatus); | |
376 | $target.html('<span class="error_red">ERROR: {0}</span>'.format(textStatus)); |
|
378 | $target.html('<span class="error_red">ERROR: {0}</span>'.format(textStatus)); | |
377 | $target.css('opacity','1.0'); |
|
379 | $target.css('opacity','1.0'); |
@@ -146,10 +146,16 b'' | |||||
146 |
|
146 | |||
147 | pyroutes.register('pullrequest_repo_info', "${url('pullrequest_repo_info',repo_name='%(repo_name)s')}", ['repo_name']); |
|
147 | pyroutes.register('pullrequest_repo_info', "${url('pullrequest_repo_info',repo_name='%(repo_name)s')}", ['repo_name']); | |
148 |
|
148 | |||
|
149 | var pendingajax = undefined; | |||
149 | var otherrepoChanged = function(){ |
|
150 | var otherrepoChanged = function(){ | |
150 | var repo_name = $('#other_repo').val(); |
|
151 | var repo_name = $('#other_repo').val(); | |
151 | ajaxGET(pyroutes.url('pullrequest_repo_info', {"repo_name": repo_name}), |
|
152 | if (pendingajax) { | |
|
153 | pendingajax.abort(); | |||
|
154 | pendingajax = undefined; | |||
|
155 | } | |||
|
156 | pendingajax = ajaxGET(pyroutes.url('pullrequest_repo_info', {"repo_name": repo_name}), | |||
152 | function(o){ |
|
157 | function(o){ | |
|
158 | pendingajax = undefined; | |||
153 | var data = JSON.parse(o.responseText); |
|
159 | var data = JSON.parse(o.responseText); | |
154 | $('#other_repo_desc').html(data.description); |
|
160 | $('#other_repo_desc').html(data.description); | |
155 |
|
161 | |||
@@ -217,7 +223,12 b'' | |||||
217 | url = url.replace(k,rev_data[k]); |
|
223 | url = url.replace(k,rev_data[k]); | |
218 | } |
|
224 | } | |
219 |
|
225 | |||
220 | asynchtml(url, $('#pull_request_overview'), function(o){ |
|
226 | if (pendingajax) { | |
|
227 | pendingajax.abort(); | |||
|
228 | pendingajax = undefined; | |||
|
229 | } | |||
|
230 | pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){ | |||
|
231 | pendingajax = undefined; | |||
221 | var jsdata = eval('('+YUD.get('jsdata').innerHTML+')'); // TODO: just get json |
|
232 | var jsdata = eval('('+YUD.get('jsdata').innerHTML+')'); // TODO: just get json | |
222 | var r = new BranchRenderer('graph_canvas', 'graph_content_pr'); |
|
233 | var r = new BranchRenderer('graph_canvas', 'graph_content_pr'); | |
223 | r.render(jsdata,100); |
|
234 | r.render(jsdata,100); |
General Comments 0
You need to be logged in to leave comments.
Login now