2012-05-31 17:56:27 +01:00
|
|
|
$(document).ready(function() {
|
2012-08-08 18:57:03 +01:00
|
|
|
var upd_action = $('#update_action').val();
|
|
|
|
var form = $('#new_pull_request');
|
|
|
|
|
2013-10-22 11:02:02 +01:00
|
|
|
function updatePull(event, data) {
|
2012-10-01 17:03:08 +01:00
|
|
|
form.attr('action', upd_action)
|
|
|
|
.attr('method', 'get');
|
2012-07-09 19:41:39 +01:00
|
|
|
$('#update_pull').fadeIn('fast');
|
2012-07-10 17:07:51 +01:00
|
|
|
$('#create_pull').fadeOut('fast');
|
2013-10-22 11:02:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
$('#pull_request_to_project').on('autocompleteselect', function(event, data){
|
|
|
|
var ref = $('#to_ref');
|
|
|
|
ref.parent().load(data.item.get_refs_url+' #to_ref', {"selected": ref.val()});
|
2012-07-09 19:41:39 +01:00
|
|
|
});
|
2012-08-08 16:47:58 +01:00
|
|
|
|
2013-10-22 11:02:02 +01:00
|
|
|
$('#pull_request_to_project').on('autocompleteselect', updatePull);
|
|
|
|
$('select#to_ref, select#from_ref').on('change', updatePull);
|
|
|
|
|
2012-10-01 17:03:08 +01:00
|
|
|
$('#pull_tabs a').on('click', function (e) {
|
2012-08-08 16:47:58 +01:00
|
|
|
var href = $(this).attr("href");
|
|
|
|
|
|
|
|
if ( window.history && history.pushState ) {
|
|
|
|
history.pushState("", "", href);
|
|
|
|
history.replaceState("", "", href);
|
|
|
|
} else {
|
|
|
|
location.hash = href;
|
|
|
|
}
|
|
|
|
});
|
2012-10-12 19:12:04 +01:00
|
|
|
|
|
|
|
var diff_tab = $('#pull_tabs a[href="#diff"]');
|
|
|
|
$('.link_to_full_changes').on('click', function(){
|
|
|
|
diff_tab.tab('show');
|
|
|
|
});
|
2012-05-31 17:56:27 +01:00
|
|
|
});
|