--- loncom/interface/lonconfigsettings.pm 2020/04/09 20:34:29 1.21.4.9.6.1 +++ loncom/interface/lonconfigsettings.pm 2020/05/22 22:38:55 1.21.4.9.6.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: lonconfigsettings.pm,v 1.21.4.9.6.1 2020/04/09 20:34:29 raeburn Exp $ +# $Id: lonconfigsettings.pm,v 1.21.4.9.6.2 2020/05/22 22:38:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -176,13 +176,11 @@ $jscript $additem = {'add_entries' => \%loaditems,}; } elsif ($phase eq 'display') { if ($context eq 'domain') { + my $onload; if (grep(/^coursedefaults$/,@actions)) { - my %loaditems = ( - ' onload' => "toggleDisplay(document.display,'cloneinstcode');". - "toggleDisplay(document.display,'credits');". - "toggleDisplay(document.display,'studentsubmission');", - ); - $additem = {'add_entries' => \%loaditems,}; + $onload = "toggleDisplay(document.display,'cloneinstcode');". + "toggleDisplay(document.display,'credits');". + "toggleDisplay(document.display,'studentsubmission');"; } if (grep(/^ltitools$/,@actions)) { $onload .= "toggleLTITools(document.display,'user','add');"; @@ -195,6 +193,12 @@ $jscript } } } + if ($onload) { + my %loaditems = ( + 'onload' => $onload, + ); + $additem = {'add_entries' => \%loaditems,}; + } } elsif ($context eq 'course') { if (grep(/^courseinfo$/,@actions)) { if (@code_order) {