rosa-build/app/assets/javascripts/extra/pull.js

27 lines
822 B
JavaScript
Raw Normal View History

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');
$('#pull_request_base_project').on('autocompleteselect', function(event, data){
$('input#base_refs').autocomplete('option', 'source', data.item.refs);
});
$('#pull_request_base_project, input#base_refs, input#head_refs').on('autocompleteselect', function(event, data){
2012-08-08 18:57:03 +01:00
form.attr('action', upd_action);
form.attr('method', 'get');
$('#update_pull').fadeIn('fast');
$('#create_pull').fadeOut('fast');
});
$('#pull_tabs a').live('click', function (e) {
var href = $(this).attr("href");
if ( window.history && history.pushState ) {
history.pushState("", "", href);
history.replaceState("", "", href);
} else {
location.hash = href;
}
});
2012-05-31 17:56:27 +01:00
});