react-router-modal
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -10,2 +10,3 @@ 'use strict'; | ||
exports.mountModal = mountModal; | ||
exports.updateModal = updateModal; | ||
exports.unmountModal = unmountModal; | ||
@@ -56,2 +57,13 @@ | ||
function updateModal(id, info) { | ||
modals = modals.map(function (m) { | ||
return m.id === id ? { | ||
id: id, | ||
info: info | ||
} : m; | ||
}); | ||
notifyChanged(modals); | ||
} | ||
function unmountModal(id) { | ||
@@ -58,0 +70,0 @@ modals = modals.filter(function (m) { |
@@ -26,2 +26,4 @@ 'use strict'; | ||
linkClassName = props.linkClassName, | ||
match = props.match, | ||
parentPath = props.parentPath, | ||
modalClassName = props.modalClassName; | ||
@@ -37,4 +39,6 @@ | ||
path: path, | ||
props: props.props, | ||
component: component, | ||
className: modalClassName | ||
className: modalClassName, | ||
parentPath: parentPath || match.url | ||
}) | ||
@@ -41,0 +45,0 @@ ); |
@@ -55,2 +55,22 @@ 'use strict'; | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(next) { | ||
var className = next.className, | ||
children = next.children, | ||
component = next.component, | ||
stackOrder = next.stackOrder, | ||
props = next.props, | ||
onBackdropClick = next.onBackdropClick; | ||
(0, _modal_container.updateModal)(this.state.id, { | ||
component: component, | ||
children: children, | ||
props: props || {}, | ||
stackOrder: stackOrder, | ||
onBackdropClick: onBackdropClick, | ||
className: className | ||
}); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
@@ -57,0 +77,0 @@ value: function componentWillUnmount() { |
{ | ||
"name": "react-router-modal", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "simple react router modal", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -12,2 +12,3 @@ ## react-router-modal | ||
`npm install react-router-modal --save` | ||
`yarn add react-router-modal` | ||
@@ -19,2 +20,3 @@ | ||
`react-router-dom` *version 4* | ||
`react` & `react-dom`, version 15 | ||
@@ -21,0 +23,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
139856
352
206