@@ -143,90 +143,90 @@ ${self.repo_context_bar('showpullrequest
// re-populate the select2 thingy
$("#other_ref").select2({
dropdownAutoWidth: true
});
$other_ref.prop('disabled', false);
loadPreview();
};
var loadPreview = function(){
//url template
var url = "${h.url('compare_url',
repo_name='__other_repo__',
org_ref_type='rev',
org_ref_name='__other_ref_name__',
other_repo='__org_repo__',
other_ref_type='rev',
other_ref_name='__org_ref_name__',
as_form=True,
merge=True,
)}";
var org_repo = $('#pull_request_form #org_repo').val();
var org_ref = $('#pull_request_form #org_ref').val().split(':');
## TODO: make nice link like link_to_ref() do
$('#org_rev_span').html(org_ref[2].substr(0,12));
var other_repo = $('#pull_request_form #other_repo').val();
var other_ref = $('#pull_request_form #other_ref').val().split(':');
$('#other_rev_span').html(other_ref[2].substr(0,12));
var rev_data = {
'__org_repo__': org_repo,
'__org_ref_name__': org_ref[2],
'__other_repo__': other_repo,
'__other_ref_name__': other_ref[2]
}; // gather the org/other ref and repo here
for (k in rev_data){
url = url.replace(k,rev_data[k]);
}
if (pendingajax) {
pendingajax.abort();
pendingajax = undefined;
pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){
var jsdata = eval('('+YUD.get('jsdata').innerHTML+')'); // TODO: just get json
var jsdata = eval('('+$('#jsdata').html()+')'); // TODO: just get json
var r = new BranchRenderer('graph_canvas', 'graph_content_pr', 'chg_');
r.render(jsdata,100);
$(document).ready(function(){
$("#org_repo").select2({
## (org_repo can't change)
$("#org_ref").select2({
dropdownAutoWidth: true,
sortResults: branchSort
$("#org_ref").on("change", function(e){
$("#other_repo").select2({
$("#other_repo").on("change", function(e){
otherrepoChanged();
$("#other_ref").on("change", function(e){
//lazy load overview after 0.5s
setTimeout(loadPreview, 500);
</script>
</%def>
Status change: