Commit 53e7fac1 authored by Marco Sehrer's avatar Marco Sehrer
Browse files

Make sharing URL driven and nested to currentURL

parent e8d76e4b
......@@ -19,10 +19,10 @@ Aviator.setRoutes({
target: {
root: function(e) {
let modalDomNode = document.getElementById('modal');
if(modalDomNode) {
React.unmountComponentAtNode(modalDomNode);
}
// let modalDomNode = document.getElementById('modal');
// if(modalDomNode) {
// React.unmountComponentAtNode(modalDomNode);
// }
}
},
......@@ -49,10 +49,18 @@ Aviator.setRoutes({
},
'/sharing': {
'/*': 'showShareModal',
'/': 'show',
'/hide': 'hide',
target: {
showShareModal: function(e) {
show: function(e) {
React.render(<ShareModal/>, document.getElementById('modal'));
},
hide: function(e) {
let modalDomNode = document.getElementById('modal');
if(modalDomNode) {
React.unmountComponentAtNode(modalDomNode);
}
Aviator.navigate(Aviator.getCurrentURI().replace('/sharing/hide',''))
}
}
}
......
......@@ -8,7 +8,7 @@ export default class ShareButton extends React.Component {
}
showShareModal() {
Aviator.navigate('/sharing');
Aviator.navigate(Aviator.getCurrentURI()+'/sharing');
}
render() {
......
......@@ -34,7 +34,8 @@ export default class ShareModal extends React.Component {
}
hideModal() {
Aviator.navigate('/');
//window.history.back();
Aviator.navigate(Aviator.getCurrentURI()+'/hide');
}
handleSharing() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment