MCPcopy
hub / github.com/ampproject/amphtml / openInContainer

Method openInContainer

third_party/subscriptions-project/swg.js:10918–10930  ·  view source on GitHub ↗

* Opens the iframe embedded in the given container element. * @param {!Element} containerEl

(containerEl)

Source from the content-addressed store, hash-verified

10916 * @param {!Element} containerEl
10917 */
10918 openInContainer(containerEl) {
10919 const iframe = this.iframe_;
10920 if (iframe.isConnected()) {
10921 throw new Error('already opened');
10922 }
10923
10924 containerEl.appendChild(iframe.getElement());
10925
10926 return iframe.whenReady().then(() => {
10927 this.buildIframe_();
10928 return this;
10929 });
10930 }
10931
10932 /**
10933 * Build the iframe with the styling after iframe is loaded.

Callers

nothing calls this directly

Calls 5

buildIframe_Method · 0.95
isConnectedMethod · 0.45
getElementMethod · 0.45
thenMethod · 0.45
whenReadyMethod · 0.45

Tested by

no test coverage detected