File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments