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 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Redmine - project management software
  3. * Copyright (C) 2006- Jean-Philippe Lang
  4. * This code is released under the GNU General Public License.
  5. */
  6. $(document).ready(function() {
  7. /*
  8. If we're viewing a tag or branch, don't display it in the
  9. revision box
  10. */
  11. var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
  12. var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
  13. if (branch_selected || tag_selected) {
  14. $('#rev').val('');
  15. }
  16. /*
  17. Copy the branch/tag value into the revision box, then disable
  18. the dropdowns before submitting the form
  19. */
  20. $('#branch,#tag').change(function() {
  21. $('#rev').val($(this).val());
  22. $('#branch,#tag').attr('disabled', true);
  23. $(this).parent().submit();
  24. $('#branch,#tag').removeAttr('disabled');
  25. });
  26. /*
  27. Disable the branch/tag dropdowns before submitting the revision form
  28. */
  29. $('#rev').keydown(function(e) {
  30. if (e.keyCode == 13) {
  31. $('#branch,#tag').attr('disabled', true);
  32. $(this).parent().submit();
  33. $('#branch,#tag').removeAttr('disabled');
  34. }
  35. });
  36. })