Mercurial > hg > soundsoftware-site
annotate public/javascripts/repository_navigation.js @ 1274:5ea1a213c7a5 redmine-2.2-integration
Removed Ajax calls taht are no longer working in Rails 3 and started migrating them; added a new javascript file - bibliography.js - to hold the new jquery js code; added the new show_bibtex_fields.js.erb file to replace the RJS code that was in the controller.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 09 May 2013 18:44:59 +0100 |
parents | 433d4f72a19b |
children |
rev | line source |
---|---|
Chris@1115 | 1 $(document).ready(function() { |
Chris@0 | 2 /* |
Chris@0 | 3 If we're viewing a tag or branch, don't display it in the |
Chris@0 | 4 revision box |
Chris@0 | 5 */ |
Chris@1115 | 6 var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val(); |
Chris@1115 | 7 var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val(); |
Chris@0 | 8 if (branch_selected || tag_selected) { |
Chris@1115 | 9 $('#rev').val(''); |
Chris@0 | 10 } |
Chris@0 | 11 |
Chris@0 | 12 /* |
Chris@0 | 13 Copy the branch/tag value into the revision box, then disable |
Chris@0 | 14 the dropdowns before submitting the form |
Chris@0 | 15 */ |
Chris@1115 | 16 $('#branch,#tag').change(function() { |
Chris@1115 | 17 $('#rev').val($(this).val()); |
Chris@1115 | 18 $('#branch,#tag').attr('disabled', true); |
Chris@1115 | 19 $(this).parent().submit(); |
Chris@1115 | 20 $('#branch,#tag').removeAttr('disabled'); |
Chris@0 | 21 }); |
Chris@0 | 22 |
Chris@0 | 23 /* |
Chris@0 | 24 Disable the branch/tag dropdowns before submitting the revision form |
Chris@0 | 25 */ |
Chris@1115 | 26 $('#rev').keydown(function(e) { |
Chris@0 | 27 if (e.keyCode == 13) { |
Chris@1115 | 28 $('#branch,#tag').attr('disabled', true); |
Chris@1115 | 29 $(this).parent().submit(); |
Chris@1115 | 30 $('#branch,#tag').removeAttr('disabled'); |
Chris@0 | 31 } |
Chris@0 | 32 }); |
Chris@0 | 33 }) |