Skip to content

Commit 61cc778

Browse files
authored
Merge pull request #71 from UIUCLibrary/issue_70
Update the default sites for items when first team is added to fix #70
2 parents cbd8f66 + 4d96681 commit 61cc778

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

asset/js/chosen-trigger.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ window.addEventListener("load", function () {
1111
//disable the options for default so that the user cant select a default team where user isn't a memeber
1212
$("#default_team option").attr('disabled','disabled');
1313

14-
1514
// if user checks the box, update default sites based on currently selected default
1615
$("#update_default_sites").click(function() {
1716
if($(this).is(":checked")) {
@@ -20,7 +19,8 @@ window.addEventListener("load", function () {
2019
}
2120
});
2221

23-
//manage the role elements and options for default teams as teams are added/removed
22+
//as teams are added and removed, manage the form elements that depend on the team to get populated
23+
// including role elements, options for default teams, and sites
2424
$('#team').on('change', function(evt, params) {
2525

2626
if (params.selected){
@@ -59,12 +59,16 @@ window.addEventListener("load", function () {
5959
}
6060
$(`#default_team option[value=${id}]`).attr('disabled', 'disabled').trigger("chosen:updated");
6161
}
62+
if($("#update_default_sites").is(":checked")) {
63+
updateDefaultSites();
64+
}
6265
});
6366

6467
$("#default_team").on('change',function () {
6568
if($("#update_default_sites").is(":checked")) {
6669
updateDefaultSites();
6770
}
71+
6872
})
6973

7074

0 commit comments

Comments
 (0)