Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(ui): keep anchor in url on refresh #7013

Merged
merged 3 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions www/front_src/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ class App extends Component {
}

goFull = () => {
window['fullscreenParams'] = window.location.search.split('?')[1] || '';
setTimeout(()=>{
const { search, hash } = history.location
window['fullscreenParams'] = (search.split('?')[1] || '') + (hash || '')
setTimeout(() => {
this.setState({ isFullscreenEnabled: true });
},200)
}, 200)
}

removeFullscreenParams = () => {
if(history.location.pathname == '/centreon/main.php'){
if (history.location.pathname == '/centreon/main.php') {
history.push({
pathname: '/centreon/main.php',
search: window['fullscreenParams']
})
pathname: '/centreon/main.php',
search: window['fullscreenParams']
})
}
delete window['fullscreenParams'];
}
Expand Down
16 changes: 8 additions & 8 deletions www/front_src/src/route-components/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ class ModuleRoute extends Component {
render() {
const { contentHeight, loading } = this.state;
const { history } = this.props,
{ search } = history.location;
let params;
if(window['fullscreenParams']){
params = '?';
params += window['fullscreenParams'] || '';
}else{
params = search || '';
}
{ search, hash } = history.location;
let params;
if (window['fullscreenParams']) {
params = '?';
params += window['fullscreenParams'] || '';
} else {
params = (search || '') + (hash || '');
}
return (
<>
{loading &&
Expand Down