Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit 284a529

Browse files
committed
update theme license radio choices when license is selected from linear list (bug 859820)
1 parent e489e25 commit 284a529

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

media/js/impala/persona_creation.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@
8282
var $licenseField = $('#id_license');
8383

8484
function licenseUpdate(updateList) {
85+
// Select "Yes" if nothing was selected (this is the implied answer).
86+
$('#cc-chooser .radios').each(function() {
87+
var $this = $(this);
88+
if (!$this.find('input:checked').length) {
89+
$this.find('input[value="0"]').prop('checked', true);
90+
}
91+
});
92+
8593
var licenseClass;
8694
if ($('input[data-cc="copyr"]:checked').length) {
8795
licenseClass = 'copyr';
@@ -146,14 +154,6 @@
146154
_.each(licenseClassesById[+$licenseField.val()].split(' '), function(cc) {
147155
$('input[type=radio][data-cc="' + cc + '"]').prop('checked', true);
148156
});
149-
150-
// Select "Yes" if nothing was selected (this is the implied answer).
151-
$('#cc-chooser .radios').each(function() {
152-
var $this = $(this);
153-
if (!$this.find('input:checked').length) {
154-
$this.find('input[value="0"]').prop('checked', true);
155-
}
156-
});
157157
}
158158

159159
// Based on whether the "All Rights Reserved" license is selected,

0 commit comments

Comments
 (0)