To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / public / javascripts / repository_navigation.js @ 1360:45dbcd39b9e9
History | View | Annotate | Download (965 Bytes)
| 1 |
$(document).ready(function() { |
|---|---|
| 2 |
/*
|
| 3 |
If we're viewing a tag or branch, don't display it in the
|
| 4 |
revision box
|
| 5 |
*/
|
| 6 |
var branch_selected = $('#branch').length > 0 && $('#rev').val() == $('#branch').val(); |
| 7 |
var tag_selected = $('#tag').length > 0 && $('#rev').val() == $('#tag').val(); |
| 8 |
if (branch_selected || tag_selected) {
|
| 9 |
$('#rev').val(''); |
| 10 |
} |
| 11 |
|
| 12 |
/*
|
| 13 |
Copy the branch/tag value into the revision box, then disable
|
| 14 |
the dropdowns before submitting the form
|
| 15 |
*/
|
| 16 |
$('#branch,#tag').change(function() { |
| 17 |
$('#rev').val($(this).val()); |
| 18 |
$('#branch,#tag').attr('disabled', true); |
| 19 |
$(this).parent().submit(); |
| 20 |
$('#branch,#tag').removeAttr('disabled'); |
| 21 |
}); |
| 22 |
|
| 23 |
/*
|
| 24 |
Disable the branch/tag dropdowns before submitting the revision form
|
| 25 |
*/
|
| 26 |
$('#rev').keydown(function(e) { |
| 27 |
if (e.keyCode == 13) { |
| 28 |
$('#branch,#tag').attr('disabled', true); |
| 29 |
$(this).parent().submit(); |
| 30 |
$('#branch,#tag').removeAttr('disabled'); |
| 31 |
} |
| 32 |
}); |
| 33 |
}) |