2012-07-22 17:29:26 +04:00
|
|
|
$(document).ready(function() {
|
2009-08-16 02:41:40 +04:00
|
|
|
/*
|
|
|
|
If we're viewing a tag or branch, don't display it in the
|
|
|
|
revision box
|
|
|
|
*/
|
2012-07-22 17:29:26 +04:00
|
|
|
var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
|
|
|
|
var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
|
2009-08-16 02:41:40 +04:00
|
|
|
if (branch_selected || tag_selected) {
|
2012-07-22 17:29:26 +04:00
|
|
|
$('#rev').val('');
|
2009-08-16 02:41:40 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Copy the branch/tag value into the revision box, then disable
|
|
|
|
the dropdowns before submitting the form
|
|
|
|
*/
|
2012-07-28 19:45:36 +04:00
|
|
|
$('#branch,#tag').change(function() {
|
|
|
|
$('#rev').val($(this).val());
|
|
|
|
$('#branch,#tag').attr('disabled', true);
|
|
|
|
$(this).parent().submit();
|
|
|
|
$('#branch,#tag').removeAttr('disabled');
|
2009-08-16 02:41:40 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
Disable the branch/tag dropdowns before submitting the revision form
|
|
|
|
*/
|
2012-07-22 17:29:26 +04:00
|
|
|
$('#rev').keydown(function(e) {
|
2009-08-16 02:41:40 +04:00
|
|
|
if (e.keyCode == 13) {
|
2012-07-22 17:29:26 +04:00
|
|
|
$('#branch,#tag').attr('disabled', true);
|
|
|
|
$(this).parent().submit();
|
|
|
|
$('#branch,#tag').removeAttr('disabled');
|
2009-08-16 02:41:40 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|