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