JQuery in, Prototype/Scriptaculous out (#11445).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10068 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-22 13:29:26 +00:00
parent 387836f8aa
commit 6a2ca5e034
122 changed files with 1431 additions and 10962 deletions

View File

@@ -1,35 +1,35 @@
Event.observe(window,'load',function() {
$(document).ready(function() {
/*
If we're viewing a tag or branch, don't display it in the
revision box
*/
var branch_selected = $('branch') && $('rev').getValue() == $('branch').getValue();
var tag_selected = $('tag') && $('rev').getValue() == $('tag').getValue();
var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val();
var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val();
if (branch_selected || tag_selected) {
$('rev').setValue('');
$('#rev').val('');
}
/*
Copy the branch/tag value into the revision box, then disable
the dropdowns before submitting the form
*/
$$('#branch,#tag').each(function(e) {
e.observe('change',function(e) {
$('rev').setValue(e.element().getValue());
$$('#branch,#tag').invoke('disable');
e.element().parentNode.submit();
$$('#branch,#tag').invoke('enable');
$('#branch,#tag').each(function() {
$(this).change(function() {
$('#rev').val($(this).val());
$('#branch,#tag').attr('disabled', true);
$(this).parent().submit();
$('#branch,#tag').removeAttr('disabled');
});
});
/*
Disable the branch/tag dropdowns before submitting the revision form
*/
$('rev').observe('keydown', function(e) {
$('#rev').keydown(function(e) {
if (e.keyCode == 13) {
$$('#branch,#tag').invoke('disable');
e.element().parentNode.submit();
$$('#branch,#tag').invoke('enable');
$('#branch,#tag').attr('disabled', true);
$(this).parent().submit();
$('#branch,#tag').removeAttr('disabled');
}
});
})