From 92107e222e6f626463d0062896037cfe104bb1bc Mon Sep 17 00:00:00 2001 From: gabek Date: Fri, 30 Sep 2022 16:43:28 +0000 Subject: [PATCH] Prettified Code! --- .../js/components/external-action-modal.js | 226 +++++++++--------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/webroot/js/components/external-action-modal.js b/webroot/js/components/external-action-modal.js index bf7924919..0ce35b026 100644 --- a/webroot/js/components/external-action-modal.js +++ b/webroot/js/components/external-action-modal.js @@ -5,124 +5,124 @@ import MicroModal from '/js/web_modules/micromodal/dist/micromodal.min.js'; const html = htm.bind(h); export default class ExternalActionModal extends Component { - constructor(props) { - super(props); - this.state = { - iframeLoaded: false, - }; + constructor(props) { + super(props); + this.state = { + iframeLoaded: false, + }; - this.setIframeLoaded = this.setIframeLoaded.bind(this); - } - componentDidMount() { - // initialize and display Micromodal on mount - try { - MicroModal.init({ - awaitCloseAnimation: false, - awaitOpenAnimation: true, // if using css animations to open the modal. This allows it to wait for the animation to finish before focusing on an element inside the modal. - }); - MicroModal.show('external-actions-modal', { - onClose: this.props.onClose, - }); - } catch (e) { - console.error('modal error: ', e); - } - } + this.setIframeLoaded = this.setIframeLoaded.bind(this); + } + componentDidMount() { + // initialize and display Micromodal on mount + try { + MicroModal.init({ + awaitCloseAnimation: false, + awaitOpenAnimation: true, // if using css animations to open the modal. This allows it to wait for the animation to finish before focusing on an element inside the modal. + }); + MicroModal.show('external-actions-modal', { + onClose: this.props.onClose, + }); + } catch (e) { + console.error('modal error: ', e); + } + } - setIframeLoaded() { - this.setState({ - iframeLoaded: true, - }); - } + setIframeLoaded() { + this.setState({ + iframeLoaded: true, + }); + } - render() { - const { action, useIframe = true, customContent = null } = this.props; - const { url, title, description } = action; - const { iframeLoaded } = this.state; - const iframeStyle = iframeLoaded - ? null - : { backgroundImage: 'url(/img/loading.gif)' }; + render() { + const { action, useIframe = true, customContent = null } = this.props; + const { url, title, description } = action; + const { iframeLoaded } = this.state; + const iframeStyle = iframeLoaded + ? null + : { backgroundImage: 'url(/img/loading.gif)' }; - return html` -