IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Browse Source

Attempt to use hash history but this is not going to work.

pull/1/head
parent
commit
1340f0927d
3 changed files with 18 additions and 2 deletions
  1. +1
    -0
      frontend/package.json
  2. +3
    -0
      frontend/src/html/index.html
  3. +14
    -2
      frontend/src/js/dialog/wb-browse-dialog.js

+ 1
- 0
frontend/package.json View File

@@ -4,6 +4,7 @@
"bootstrap": "^4.4.1",
"crypto-js": "^3.1.9-1",
"filesize": "^6.0.1",
"history": "^4.10.1",
"jquery": "^3.4.1",
"js-uuid": "0.0.6",
"linkstate": "^1.1.1",


+ 3
- 0
frontend/src/html/index.html View File

@@ -4,6 +4,9 @@
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="/css/index.css" />
<script language="javascript">
window.process = { 'env': { 'NODE_ENV': 'production' } };
</script>
<script language="javascript" src="/js/jquery.min.js"></script>
<script language="javascript" src="/js/bootstrap.min.js"></script>
<script language="javascript" src="/js/fontawesome.min.js"></script>


+ 14
- 2
frontend/src/js/dialog/wb-browse-dialog.js View File

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


Loading…
Cancel
Save