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

Method open

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

* Opens the dialog and builds the iframe container. * @param {boolean=} hidden * @return {!Promise<!Dialog>}

(hidden = false)

Source from the content-addressed store, hash-verified

10885 * @return {!Promise<!Dialog>}
10886 */
10887 open(hidden = false) {
10888 const iframe = this.iframe_;
10889 if (iframe.isConnected()) {
10890 throw new Error('already opened');
10891 }
10892
10893 // Attach.
10894 this.doc_.getBody().appendChild(iframe.getElement()); // Fires onload.
10895
10896 this.graypane_.attach();
10897
10898 if (hidden) {
10899 setImportantStyles$1(iframe.getElement(), {
10900 'visibility': 'hidden',
10901 'opacity': 0,
10902 });
10903 this.hidden_ = hidden;
10904 } else {
10905 this.show_();
10906 }
10907
10908 return iframe.whenReady().then(() => {
10909 this.buildIframe_();
10910 return this;
10911 });
10912 }
10913
10914 /**
10915 * Opens the iframe embedded in the given container element.

Callers

nothing calls this directly

Calls 9

show_Method · 0.95
buildIframe_Method · 0.95
setImportantStyles$1Function · 0.85
isConnectedMethod · 0.45
getBodyMethod · 0.45
getElementMethod · 0.45
attachMethod · 0.45
thenMethod · 0.45
whenReadyMethod · 0.45

Tested by

no test coverage detected