comparison public/javascripts/repository_navigation.js @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents 513646585e45
children
comparison
equal deleted inserted replaced
929:5f33065ddc4b 1115:433d4f72a19b
1 Event.observe(window,'load',function() { 1 $(document).ready(function() {
2 /* 2 /*
3 If we're viewing a tag or branch, don't display it in the 3 If we're viewing a tag or branch, don't display it in the
4 revision box 4 revision box
5 */ 5 */
6 var branch_selected = $('branch') && $('rev').getValue() == $('branch').getValue(); 6 var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
7 var tag_selected = $('tag') && $('rev').getValue() == $('tag').getValue(); 7 var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
8 if (branch_selected || tag_selected) { 8 if (branch_selected || tag_selected) {
9 $('rev').setValue(''); 9 $('#rev').val('');
10 } 10 }
11 11
12 /* 12 /*
13 Copy the branch/tag value into the revision box, then disable 13 Copy the branch/tag value into the revision box, then disable
14 the dropdowns before submitting the form 14 the dropdowns before submitting the form
15 */ 15 */
16 $$('#branch,#tag').each(function(e) { 16 $('#branch,#tag').change(function() {
17 e.observe('change',function(e) { 17 $('#rev').val($(this).val());
18 $('rev').setValue(e.element().getValue()); 18 $('#branch,#tag').attr('disabled', true);
19 $$('#branch,#tag').invoke('disable'); 19 $(this).parent().submit();
20 e.element().parentNode.submit(); 20 $('#branch,#tag').removeAttr('disabled');
21 $$('#branch,#tag').invoke('enable');
22 });
23 }); 21 });
24 22
25 /* 23 /*
26 Disable the branch/tag dropdowns before submitting the revision form 24 Disable the branch/tag dropdowns before submitting the revision form
27 */ 25 */
28 $('rev').observe('keydown', function(e) { 26 $('#rev').keydown(function(e) {
29 if (e.keyCode == 13) { 27 if (e.keyCode == 13) {
30 $$('#branch,#tag').invoke('disable'); 28 $('#branch,#tag').attr('disabled', true);
31 e.element().parentNode.submit(); 29 $(this).parent().submit();
32 $$('#branch,#tag').invoke('enable'); 30 $('#branch,#tag').removeAttr('disabled');
33 } 31 }
34 }); 32 });
35 }) 33 })