Commit e8d76e4b authored by Marco Sehrer's avatar Marco Sehrer
Browse files

Make hide SampleDetails URL driven

parent d2783a74
......@@ -16,6 +16,7 @@ Aviator.root = '/';
Aviator.pushStateEnabled = false;
Aviator.setRoutes({
'/': 'root',
target: {
root: function(e) {
let modalDomNode = document.getElementById('modal');
......@@ -24,10 +25,15 @@ Aviator.setRoutes({
}
}
},
'/collection': {
target: {
show: function(e) {
UIActions.selectCollection({id: e['params']['id']});
UIActions.selectCollection({id: e.params['id']});
if(!e.params['sampleID'])
{
UIActions.deselectAllElements('sample');
}
}
},
'/:id': 'show'
......@@ -36,11 +42,12 @@ Aviator.setRoutes({
'/sample': {
target: {
show: function(e) {
UIActions.selectElement({type: 'sample', id: e['params']['sampleID']})
UIActions.selectElement({type: 'sample', id: e.params['sampleID']})
}
},
'/:sampleID': 'show'
},
'/sharing': {
'/*': 'showShareModal',
target: {
......
......@@ -5,7 +5,6 @@ import SVG from 'react-inlinesvg';
import ElementActions from './actions/ElementActions';
import ElementStore from './stores/ElementStore';
import UIActions from './actions/UIActions';
import UIStore from './stores/UIStore';
import NumeralInputWithUnits from './NumeralInputWithUnits'
......@@ -44,7 +43,6 @@ export default class SampleDetails extends React.Component {
closeDetails() {
let uiState = UIStore.getState();
UIActions.deselectAllElements('sample');
Aviator.navigate(`/collection/${uiState.currentCollectionId}`);
}
......
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