File tree Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 11out /
22node_modules /
3+ .idea /
Original file line number Diff line number Diff line change @@ -314,7 +314,7 @@ page](#stand-alone-page) section.
314314 // as a JSON file or events. The configUrl variable in the
315315 // loaderOptions above can be used to put these config values in a file
316316 // instead of explicitly passing it as an argument.
317- var chatbotUiconfig = {
317+ var chatbotUiConfig = {
318318 ui: {
319319 // origin of the parent site where you are including the chatbot UI
320320 // set to window.location.origin since hosting on same site
@@ -337,7 +337,7 @@ page](#stand-alone-page) section.
337337
338338 // Call the load function which returns a promise that is resolved
339339 // once the component is loaded or is rejected if there is an error
340- iframeLoader .load (chabotUiConfig )
340+ iframeLoader .load (chatbotUiConfig )
341341 .then (function () {
342342 console .log (' iframe loaded' );
343343 })
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ and (max-width: 480px) {
4444 margin-right : 2vw ;
4545 align-self : center;
4646 }
47- .lex-web-ui-ifame --minimize {
47+ .lex-web-ui-iframe --minimize {
4848 min-width : 60vw ;
4949 height : 48px ;
5050 }
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ export const configBase = {
2727 iframe : {
2828 iframeOrigin : '' ,
2929 iframeSrcPath : '' ,
30- shouldLoadIframeMinimized : true ,
3130 } ,
3231} ;
3332
Original file line number Diff line number Diff line change @@ -157,13 +157,16 @@ export class IframeLoader extends Loader {
157157 }
158158
159159 load ( configParam = { } ) {
160- this . config . iframe = this . config . iframe || { } ;
161- this . config . iframe . iframeSrcPath = this . mergeSrcPath ( configParam ) ;
162-
163160 return super . load ( configParam )
164161 . then ( ( ) => {
165162 // assign API to this object to make calls more succint
166163 this . api = this . compLoader . api ;
164+ // make sure iframe and iframeSrcPath are set to values if not
165+ // configured by standard mechanisms. At this point, default
166+ // values from ./defaults/loader.js will be used.
167+ this . config . iframe = this . config . iframe || { } ;
168+ this . config . iframe . iframeSrcPath = this . config . iframe . iframeSrcPath ||
169+ this . mergeSrcPath ( configParam ) ;
167170 } ) ;
168171 }
169172
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ export class IframeComponentLoader {
6161 this . config . iframe . iframeOrigin =
6262 this . config . parentOrigin || window . location . origin ;
6363 }
64+ if ( iframeConfig . shouldLoadIframeMinimized === undefined ) {
65+ this . config . iframe . shouldLoadIframeMinimized = true ;
66+ }
6467 // assign parentOrigin if not found in config
6568 if ( ! ( this . config . parentOrigin ) ) {
6669 this . config . parentOrigin =
@@ -102,6 +105,11 @@ export class IframeComponentLoader {
102105 console . error ( 'missing parentOrigin config field' ) ;
103106 return false ;
104107 }
108+ if ( ! ( 'shouldLoadIframeMinimized' in iframeConfig ) ) {
109+ console . error ( 'missing shouldLoadIframeMinimized config field' ) ;
110+ return false ;
111+ }
112+
105113 return true ;
106114 }
107115
You can’t perform that action at this time.
0 commit comments