|
@@ -2,11 +2,14 @@ import { h, Component } from 'preact'; |
|
|
import WBBrowseDialogProjectList from 'wb-browse-dialog-project-list';
|
|
|
import WBBrowseDialogProjectList from 'wb-browse-dialog-project-list';
|
|
|
import WBBrowseDialogCollectionList from 'wb-browse-dialog-project-list';
|
|
|
import WBBrowseDialogCollectionList from 'wb-browse-dialog-project-list';
|
|
|
import linkState from 'linkstate';
|
|
|
import linkState from 'linkstate';
|
|
|
|
|
|
import { Router } from 'preact-router';
|
|
|
|
|
|
import { createHashHistory } from 'history';
|
|
|
|
|
|
|
|
|
class WBBrowseDialog extends Component {
|
|
|
class WBBrowseDialog extends Component {
|
|
|
constructor(...args) {
|
|
|
constructor(...args) {
|
|
|
super(...args);
|
|
|
super(...args);
|
|
|
this.state.history = [];
|
|
|
this.state.history = [];
|
|
|
|
|
|
this.state.history_1 = createHashHistory();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
resetSearch() {
|
|
|
resetSearch() {
|
|
@@ -17,7 +20,7 @@ class WBBrowseDialog extends Component { |
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pushHistory(child) {
|
|
|
pushHistory(child) {
|
|
|
const { history } = this.state;
|
|
|
|
|
|
|
|
|
const { history, textSearch } = this.state;
|
|
|
history.push([ child, { textSearch } ]);
|
|
|
history.push([ child, { textSearch } ]);
|
|
|
this.state.history = history.slice(history.length - 1000);
|
|
|
this.state.history = history.slice(history.length - 1000);
|
|
|
}
|
|
|
}
|
|
@@ -30,7 +33,7 @@ class WBBrowseDialog extends Component { |
|
|
entry[0].popHistory();
|
|
|
entry[0].popHistory();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
render({ app, id }, { mode, textSearch, textSearchInput }) {
|
|
|
|
|
|
|
|
|
render({ app, id }, { mode, textSearch, textSearchInput, history, history_1 }) {
|
|
|
return (
|
|
|
return (
|
|
|
<div class="modal" id={ id } tabindex="-1" role="dialog">
|
|
|
<div class="modal" id={ id } tabindex="-1" role="dialog">
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
@@ -43,6 +46,15 @@ class WBBrowseDialog extends Component { |
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
<div class="modal-body">
|
|
|
|
|
|
<Router history={ history_1 }>
|
|
|
|
|
|
<div path="/a">
|
|
|
|
|
|
A
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div path="/b">
|
|
|
|
|
|
B
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Router>
|
|
|
|
|
|
|
|
|
<div>
|
|
|
<div>
|
|
|
<h5>Go to: <a href="#">Home</a>, <a href="#">All Projects</a>,
|
|
|
<h5>Go to: <a href="#">Home</a>, <a href="#">All Projects</a>,
|
|
|
<a href="#">All Users</a>, <a href="#">Shared with Me</a></h5>
|
|
|
<a href="#">All Users</a>, <a href="#">Shared with Me</a></h5>
|
|
|