You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

repository_navigation.js 965B

123456789101112131415161718192021222324252627282930313233
  1. $(document).ready(function() {
  2. /*
  3. If we're viewing a tag or branch, don't display it in the
  4. revision box
  5. */
  6. var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
  7. var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
  8. if (branch_selected || tag_selected) {
  9. $('#rev').val('');
  10. }
  11. /*
  12. Copy the branch/tag value into the revision box, then disable
  13. the dropdowns before submitting the form
  14. */
  15. $('#branch,#tag').change(function() {
  16. $('#rev').val($(this).val());
  17. $('#branch,#tag').attr('disabled', true);
  18. $(this).parent().submit();
  19. $('#branch,#tag').removeAttr('disabled');
  20. });
  21. /*
  22. Disable the branch/tag dropdowns before submitting the revision form
  23. */
  24. $('#rev').keydown(function(e) {
  25. if (e.keyCode == 13) {
  26. $('#branch,#tag').attr('disabled', true);
  27. $(this).parent().submit();
  28. $('#branch,#tag').removeAttr('disabled');
  29. }
  30. });
  31. })