* Closes the dialog. * @param {boolean=} animated * @return {!Promise}
(animated = true)
| 10971 | * @return {!Promise} |
| 10972 | */ |
| 10973 | close(animated = true) { |
| 10974 | let animating; |
| 10975 | if (animated) { |
| 10976 | const transitionStyles = this.shouldPositionCenter_() |
| 10977 | ? {'opacity': 0} |
| 10978 | : {'transform': 'translateY(100%)'}; |
| 10979 | |
| 10980 | animating = this.animate_(() => { |
| 10981 | this.graypane_.hide(/* animate */ true); |
| 10982 | return transition$1(this.getElement(), transitionStyles, 300, 'ease-out'); |
| 10983 | }); |
| 10984 | } else { |
| 10985 | animating = Promise.resolve(); |
| 10986 | } |
| 10987 | |
| 10988 | this.doc_.getBody().classList.remove('swg-disable-scroll'); |
| 10989 | |
| 10990 | return animating.then(() => { |
| 10991 | const iframeEl = this.iframe_.getElement(); |
| 10992 | iframeEl.parentNode.removeChild(iframeEl); |
| 10993 | |
| 10994 | this.removePaddingToHtml_(); |
| 10995 | this.graypane_.destroy(); |
| 10996 | if (this.desktopMediaQueryListener_) { |
| 10997 | this.desktopMediaQuery_.removeListener(this.desktopMediaQueryListener_); |
| 10998 | } |
| 10999 | }); |
| 11000 | } |
| 11001 | |
| 11002 | /** |
| 11003 | * Gets the container within the dialog. |
nothing calls this directly
no test coverage detected