Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-33822] Handled when CopyFrom is focused
  • Loading branch information
recena committed Apr 10, 2016
1 parent ece6606 commit fc05e5c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions war/src/main/js/add-item.js
Expand Up @@ -130,14 +130,13 @@ $.when(getItems()).done(function(data) {
$item.click(select);

$item.keypress(function(e) {
switch (e.keyCode) {
case 0:
switch (e.which) {
case 13:
case 32:
$(this).trigger('click');
e.stopPropagation();
break;
}
e.stopPropagation();
});

return $item;
Expand Down Expand Up @@ -195,14 +194,14 @@ $.when(getItems()).done(function(data) {
});

// Init CopyFromField
$('input[name="from"]', '#createItem').focus(function() {
$('#createItem').find('input[type="radio"][value="copy"]').prop('checked', true);
$('.categories').find('.active').removeClass('active');
});

$('input[name="from"]', '#createItem').blur(function() {
if (getCopyFromValue() === '') {
$('#createItem').find('input[type="radio"][value="copy"]').prop('checked', false);
$('#createItem').find('input[type="radio"][value="copy"]').removeAttr('checked');
} else {
$('.categories').find('li[role="radio"]').attr("aria-checked", "false");
$('#createItem').find('input[type="radio"][name="mode"]').removeAttr('checked');
$('.categories').find('.active').removeClass('active');
$('#createItem').find('input[type="radio"][value="copy"]').prop('checked', true);
}
});

Expand Down

0 comments on commit fc05e5c

Please sign in to comment.