mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 09:16:02 +01:00
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:
@@ -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');
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user