From a1d29c6593b0c867d2f8e3af6b917ee52d4057e2 Mon Sep 17 00:00:00 2001 From: Vitaly Kravtsov Date: Thu, 2 Mar 2017 11:52:33 +0600 Subject: [PATCH] [fixed] rewrite removePortal as es5 function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uglifyjs doesn't know anything about es6, so 1.7.0 breaks my build script with error ``` ERROR in index_586f597d6f9d7177eb8b.js from UglifyJs SyntaxError: Unexpected token punc «(», expected punc «:» [./~/react-modal/lib/components/Modal.js:103,0] ``` fix es6 -> es5 --- lib/components/Modal.js | 2 +- lib/components/ModalPortal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 729b17c7..59426dda 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -100,7 +100,7 @@ var Modal = React.createClass({ } }, - removePortal () { + removePortal: function() { ReactDOM.unmountComponentAtNode(this.node); var parent = getParentElement(this.props.parentSelector); parent.removeChild(this.node); diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 0b1d518e..4045636c 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -77,7 +77,7 @@ var ModalPortal = module.exports = React.createClass({ focusManager.teardownScopedFocus(); }, - open () { + open: function () { if (this.state.afterOpen && this.state.beforeClose) { clearTimeout(this.closeTimer); this.setState({ beforeClose: false });