@@ -57,7 +57,13 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
5757 } else {
5858 $ ( element ) . find ( ".l1p1" ) . addClass ( "hidden" ) ;
5959 $ ( element ) . find ( ".l1p3" ) . removeClass ( "hidden" ) ;
60-
60+ if ( configType !== "new" ) {
61+ $ ( element ) . find ( ".no-external-config" ) . addClass ( "hidden" ) ;
62+ $ ( element ) . find ( ".external-config" ) . removeClass ( "hidden" ) ;
63+ } else {
64+ $ ( element ) . find ( ".external-config" ) . addClass ( "hidden" ) ;
65+ $ ( element ) . find ( ".no-external-config" ) . removeClass ( "hidden" ) ;
66+ }
6167 }
6268
6369 if ( configType === "new" ) {
@@ -69,8 +75,15 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
6975 }
7076
7177 if ( configType === "external" ) {
72- // Conditionally show the LTI 1.3 launch URL field if external multiple launch URLs are enabled.
73- toggleFieldVisibility ( "lti_1p3_launch_url" , data . EXTERNAL_MULTIPLE_LAUNCH_URLS_ENABLED ) ;
78+ if ( data . EXTERNAL_MULTIPLE_LAUNCH_URLS_ENABLED ) {
79+ // Conditionally show the LTI 1.3 launch URL field if external multiple launch URLs are enabled.
80+ toggleFieldVisibility ( "lti_1p3_launch_url" , true ) ;
81+ $ ( element ) . find ( ".field-group-lti-configuration-details.l1p3" ) . addClass ( "hidden" ) ;
82+ } else {
83+ toggleFieldVisibility ( "lti_1p3_launch_url" , false ) ;
84+ // Also hides the field-group-lti-configuration-details as it is empty in this case
85+ $ ( element ) . find ( ".field-group-lti-configuration-details.l1p3" ) . addClass ( "hidden" ) ;
86+ }
7487 }
7588 }
7689
@@ -158,18 +171,18 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
158171 * @param {string } step - The step to deactivate.
159172 */
160173 function deactivateCurrentStep ( ) {
161- $ ( element ) . find ( `.step-header-${ currentStep } ` ) . removeClass ( "pgn__stepper-header-step-active" ) ;
162- $ ( element ) . find ( `.step-${ currentStep } ` ) . addClass ( "hidden" ) ;
163- } ;
174+ $ ( element ) . find ( `.step-header-${ currentStep } ` ) . removeClass ( "pgn__stepper-header-step-active" ) ;
175+ $ ( element ) . find ( `.step-${ currentStep } ` ) . addClass ( "hidden" ) ;
176+ }
164177
165178 /**
166179 * Show the current step and activate the step header.
167180 *
168181 * @param {string } step - The step to activate.
169182 */
170183 function activateCurrentStep ( ) {
171- $ ( element ) . find ( `.step-header-${ currentStep } ` ) . addClass ( "pgn__stepper-header-step-active" ) ;
172- $ ( element ) . find ( `.step-${ currentStep } ` ) . removeClass ( "hidden" ) ;
184+ $ ( element ) . find ( `.step-header-${ currentStep } ` ) . addClass ( "pgn__stepper-header-step-active" ) ;
185+ $ ( element ) . find ( `.step-${ currentStep } ` ) . removeClass ( "hidden" ) ;
173186 }
174187
175188 /**
@@ -178,10 +191,10 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
178191 * @param {string } step - The step to change to.
179192 */
180193 function changeStep ( step ) {
181- deactivateCurrentStep ( ) ;
182- currentStep = step ;
183- activateCurrentStep ( ) ;
184- handlePrevNextButtonVisibility ( ) ;
194+ deactivateCurrentStep ( ) ;
195+ currentStep = step ;
196+ activateCurrentStep ( ) ;
197+ handlePrevNextButtonVisibility ( ) ;
185198 }
186199
187200 // Show or hide fields based on the selected options
@@ -209,7 +222,6 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
209222 $ ( wrapper ) . addClass ( "is-set" ) ;
210223 } ) ;
211224
212-
213225 // Bind to onChange method of lti_version selector
214226 $ ( element )
215227 . find ( "[id^=lti_version_option-]" )
@@ -359,7 +371,6 @@ function LtiConsumerXBlockInitStudio(runtime, element, data) {
359371 changeStep ( "review" ) ;
360372 } ) ;
361373
362-
363374 /**
364375 * Return whether the field is set or not.
365376 *
0 commit comments