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.0KB

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