Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
out/
node_modules/
.idea/
1 change: 0 additions & 1 deletion src/lex-web-ui-loader/js/defaults/lex-web-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const configBase = {
iframe: {
iframeOrigin: '',
iframeSrcPath: '',
shouldLoadIframeMinimized: true,
},
};

Expand Down
9 changes: 6 additions & 3 deletions src/lex-web-ui-loader/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ export class IframeLoader extends Loader {
}

load(configParam = {}) {
this.config.iframe = this.config.iframe || {};
this.config.iframe.iframeSrcPath = this.mergeSrcPath(configParam);

return super.load(configParam)
.then(() => {
// assign API to this object to make calls more succint
this.api = this.compLoader.api;
// make sure iframe and iframeSrcPath are set to values if not
// configured by standard mechanisms. At this point, default
// values from ./defaults/loader.js will be used.
this.config.iframe = this.config.iframe || {};
this.config.iframe.iframeSrcPath = this.config.iframe.iframeSrcPath ||
this.mergeSrcPath(configParam);
});
}

Expand Down
8 changes: 8 additions & 0 deletions src/lex-web-ui-loader/js/lib/iframe-component-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export class IframeComponentLoader {
this.config.iframe.iframeOrigin =
this.config.parentOrigin || window.location.origin;
}
if (iframeConfig.shouldLoadIframeMinimized === undefined) {
this.config.iframe.shouldLoadIframeMinimized = true;
}
// assign parentOrigin if not found in config
if (!(this.config.parentOrigin)) {
this.config.parentOrigin =
Expand Down Expand Up @@ -102,6 +105,11 @@ export class IframeComponentLoader {
console.error('missing parentOrigin config field');
return false;
}
if (!('shouldLoadIframeMinimized' in iframeConfig)) {
console.error('missing shouldLoadIframeMinimized config field');
return false;
}

return true;
}

Expand Down