rmc-dialog
Advanced tools
@@ -11,2 +11,3 @@ /// <reference types="react" /> | ||
| _component: any; | ||
| container: any; | ||
| componentDidMount(): void; | ||
@@ -21,5 +22,5 @@ shouldComponentUpdate({visible}: { | ||
| removeContainer: () => void; | ||
| getContainer: () => Element; | ||
| getContainer: () => any; | ||
| renderDialog(visible: any): void; | ||
| render(): any; | ||
| } |
+10
-10
@@ -35,19 +35,19 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
| _this.removeContainer = function () { | ||
| var container = document.querySelector('#' + _this.props.prefixCls + '-container'); | ||
| if (container) { | ||
| if (_this.container) { | ||
| if (!IS_REACT_16) { | ||
| ReactDOM.unmountComponentAtNode(container); | ||
| ReactDOM.unmountComponentAtNode(_this.container); | ||
| } | ||
| container.parentNode.removeChild(container); | ||
| _this.container.parentNode.removeChild(_this.container); | ||
| _this.container = null; | ||
| } | ||
| }; | ||
| _this.getContainer = function () { | ||
| var prefixCls = _this.props.prefixCls; | ||
| var container = document.querySelector('#' + prefixCls + '-container'); | ||
| if (!container) { | ||
| container = document.createElement('div'); | ||
| container.setAttribute('id', prefixCls + '-container'); | ||
| if (!_this.container) { | ||
| var container = document.createElement('div'); | ||
| var containerId = _this.props.prefixCls + '-container-' + new Date().getTime(); | ||
| container.setAttribute('id', containerId); | ||
| document.body.appendChild(container); | ||
| _this.container = container; | ||
| } | ||
| return container; | ||
| return _this.container; | ||
| }; | ||
@@ -54,0 +54,0 @@ return _this; |
@@ -11,2 +11,3 @@ /// <reference types="react" /> | ||
| _component: any; | ||
| container: any; | ||
| componentDidMount(): void; | ||
@@ -21,5 +22,5 @@ shouldComponentUpdate({visible}: { | ||
| removeContainer: () => void; | ||
| getContainer: () => Element; | ||
| getContainer: () => any; | ||
| renderDialog(visible: any): void; | ||
| render(): any; | ||
| } |
+10
-10
@@ -67,19 +67,19 @@ 'use strict'; | ||
| _this.removeContainer = function () { | ||
| var container = document.querySelector('#' + _this.props.prefixCls + '-container'); | ||
| if (container) { | ||
| if (_this.container) { | ||
| if (!IS_REACT_16) { | ||
| _reactDom2['default'].unmountComponentAtNode(container); | ||
| _reactDom2['default'].unmountComponentAtNode(_this.container); | ||
| } | ||
| container.parentNode.removeChild(container); | ||
| _this.container.parentNode.removeChild(_this.container); | ||
| _this.container = null; | ||
| } | ||
| }; | ||
| _this.getContainer = function () { | ||
| var prefixCls = _this.props.prefixCls; | ||
| var container = document.querySelector('#' + prefixCls + '-container'); | ||
| if (!container) { | ||
| container = document.createElement('div'); | ||
| container.setAttribute('id', prefixCls + '-container'); | ||
| if (!_this.container) { | ||
| var container = document.createElement('div'); | ||
| var containerId = _this.props.prefixCls + '-container-' + new Date().getTime(); | ||
| container.setAttribute('id', containerId); | ||
| document.body.appendChild(container); | ||
| _this.container = container; | ||
| } | ||
| return container; | ||
| return _this.container; | ||
| }; | ||
@@ -86,0 +86,0 @@ return _this; |
+1
-1
| { | ||
| "name": "rmc-dialog", | ||
| "version": "1.0.5", | ||
| "version": "1.0.6", | ||
| "description": "mobile dialog ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
1553
0.13%67821
-0.02%