Chris@1295: $(document).ready(function() { Chris@1295: /* Chris@1295: If we're viewing a tag or branch, don't display it in the Chris@1295: revision box Chris@1295: */ Chris@1295: var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val(); Chris@1295: var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val(); Chris@1295: if (branch_selected || tag_selected) { Chris@1295: $('#rev').val(''); Chris@1295: } Chris@1295: Chris@1295: /* Chris@1295: Copy the branch/tag value into the revision box, then disable Chris@1295: the dropdowns before submitting the form Chris@1295: */ Chris@1295: $('#branch,#tag').change(function() { Chris@1295: $('#rev').val($(this).val()); Chris@1295: $('#branch,#tag').attr('disabled', true); Chris@1295: $(this).parent().submit(); Chris@1295: $('#branch,#tag').removeAttr('disabled'); Chris@1295: }); Chris@1295: Chris@1295: /* Chris@1295: Disable the branch/tag dropdowns before submitting the revision form Chris@1295: */ Chris@1295: $('#rev').keydown(function(e) { Chris@1295: if (e.keyCode == 13) { Chris@1295: $('#branch,#tag').attr('disabled', true); Chris@1295: $(this).parent().submit(); Chris@1295: $('#branch,#tag').removeAttr('disabled'); Chris@1295: } Chris@1295: }); Chris@1295: })