Mercurial > hg > soundsoftware-site
annotate .svn/pristine/db/dbbe02344b02394382c3153c6c0b7b7ba7f46fe0.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration
Fix failure to interpret Javascript when autocompleting members for project
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Thu, 11 Sep 2014 10:24:38 +0100 |
parents | cbb26bc654de |
children |
rev | line source |
---|---|
Chris@909 | 1 Event.observe(window,'load',function() { |
Chris@909 | 2 /* |
Chris@909 | 3 If we're viewing a tag or branch, don't display it in the |
Chris@909 | 4 revision box |
Chris@909 | 5 */ |
Chris@909 | 6 var branch_selected = $('branch') && $('rev').getValue() == $('branch').getValue(); |
Chris@909 | 7 var tag_selected = $('tag') && $('rev').getValue() == $('tag').getValue(); |
Chris@909 | 8 if (branch_selected || tag_selected) { |
Chris@909 | 9 $('rev').setValue(''); |
Chris@909 | 10 } |
Chris@909 | 11 |
Chris@909 | 12 /* |
Chris@909 | 13 Copy the branch/tag value into the revision box, then disable |
Chris@909 | 14 the dropdowns before submitting the form |
Chris@909 | 15 */ |
Chris@909 | 16 $$('#branch,#tag').each(function(e) { |
Chris@909 | 17 e.observe('change',function(e) { |
Chris@909 | 18 $('rev').setValue(e.element().getValue()); |
Chris@909 | 19 $$('#branch,#tag').invoke('disable'); |
Chris@909 | 20 e.element().parentNode.submit(); |
Chris@909 | 21 $$('#branch,#tag').invoke('enable'); |
Chris@909 | 22 }); |
Chris@909 | 23 }); |
Chris@909 | 24 |
Chris@909 | 25 /* |
Chris@909 | 26 Disable the branch/tag dropdowns before submitting the revision form |
Chris@909 | 27 */ |
Chris@909 | 28 $('rev').observe('keydown', function(e) { |
Chris@909 | 29 if (e.keyCode == 13) { |
Chris@909 | 30 $$('#branch,#tag').invoke('disable'); |
Chris@909 | 31 e.element().parentNode.submit(); |
Chris@909 | 32 $$('#branch,#tag').invoke('enable'); |
Chris@909 | 33 } |
Chris@909 | 34 }); |
Chris@909 | 35 }) |