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