... | ... |
@@ -18,8 +18,35 @@ |
18 | 18 |
|
19 | 19 |
%= javascript begin |
20 | 20 |
$('document').ready(function () { |
21 |
- // Scroll to right |
|
22 |
- $('#graph').scrollLeft(1000); |
|
21 |
+ |
|
22 |
+ // New button click |
|
23 |
+ $('[name=new]').on('click', function () { |
|
24 |
+ $('[name=branch_select]').val(''); |
|
25 |
+ $('[name=branch]').val(''); |
|
26 |
+ |
|
27 |
+ return false; |
|
28 |
+ }); |
|
29 |
+ |
|
30 |
+ // Select branch |
|
31 |
+ $('[name=branch_select]').on('change', function () { |
|
32 |
+ var val = $(this).val(); |
|
33 |
+ if (val === '(New)') { |
|
34 |
+ $('[name=branch]').val(''); |
|
35 |
+ } |
|
36 |
+ else if (val === '(Same name)') { |
|
37 |
+ $('[name=branch]').val($('[name=remote_branch]').val()); |
|
38 |
+ } |
|
39 |
+ else { |
|
40 |
+ $('[name=branch]').val($(this).val()); |
|
41 |
+ } |
|
42 |
+ }); |
|
43 |
+ |
|
44 |
+ // Select remote branch |
|
45 |
+ $('[name=remote_branch]').on('change', function () { |
|
46 |
+ if ($('[name=branch_select]').val() === '(Same name)') { |
|
47 |
+ $('[name=branch]').val($(this).val()); |
|
48 |
+ } |
|
49 |
+ }); |
|
23 | 50 |
}); |
24 | 51 |
% end |
25 | 52 |
|
... | ... |
@@ -33,13 +60,12 @@ |
33 | 60 |
%= "$user / $project"; |
34 | 61 |
</div> |
35 | 62 |
% param(branch_select => $rev1); |
36 |
- %= select_field 'branch_select' => ['-' => '', @$branch_names]; |
|
63 |
+ %= select_field 'branch_select' => ['(New)', '(Same name)', @$branch_names]; |
|
37 | 64 |
<div> |
38 | 65 |
% param(branch => $rev1); |
39 | 66 |
%= text_field 'branch'; |
40 | 67 |
</div> |
41 | 68 |
%= submit_button 'Pull', style => "width:100px", class => "btn", ; |
42 |
- <button class="btn" style="width:100px">Clear</button> |
|
43 | 69 |
</div> |
44 | 70 |
</div> |
45 | 71 |
<div class="span2"> |