Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make back button of browser close overlay pane in HTML panels #113

Closed
PhilippWendler opened this issue Jan 14, 2016 · 6 comments · Fixed by #573
Closed

Make back button of browser close overlay pane in HTML panels #113

PhilippWendler opened this issue Jan 14, 2016 · 6 comments · Fixed by #573

Comments

@PhilippWendler
Copy link
Member

Some users expect to be able to click on a link (such as the log files in tables) and use the back button to get back to the original page, but because we open the target of the link in an overlay pane with JavaScript, this is not possible. As it is possible to manipulate the back button of the browser through JavaScript, we should do so and make the back button close the overlay pane (or, even better, let the overlay pane show the previous content if there is one).

@kfriedberger
Copy link
Member

Should this also work for plots?
For example: first show the plot for cputime, then for walltime, then for memory.
Should the back button then also show the old plots?

There would be (at least) 2 possibilities how to implement this:

  1. We store the complete history as a list in JavaScript. The elements of the list could be callbacks to show the plot (or logfile) or something.
  2. Use the URL and encode the current view within the URL of the table. The showing a plot or sourcefile would modify the current URL.
    Example:
    .../table.html?show=plot&title=cputime,
    .../table.html?show=source&id=main.c,
    .../table.html?show=log&id=main.c.log.
    Maybe changing the URL can be done without reloading the table. In this case the browser should already handle the back-button feature, as the history of URLs is part of the browsers history. This feature would also allow us to directly use URLs to show the plot (as view above a table).

@PhilippWendler
Copy link
Member Author

I think it is not necessary for switching the shown columns inside a plot (users do not expect drop-down fields to affect history), but for switching between different plot types (by clicking on links) it could be done.

The second solution was what I had in mind, although I do not know if we maybe can do this without modifying the url (and keep more state like plot configuration than what is encoded in URL).

@PhilippWendler
Copy link
Member Author

Seems like this is easily possible: https://developer.mozilla.org/de/docs/Web/Guide/DOM/Manipulating_the_browser_history#Adding_and_modifying_history_entries

We can store arbitrary state, and we do not need to fiddle with the URL.

@kalpit4088
Copy link

@PhilippWendler can you tell me how to test pushState method on my local machine. Because whenever I try to test it on localhost it gives me this error - "SecurityError: The operation is insecure."

@PhilippWendler
Copy link
Member Author

Sorry, I never used this function myself. I suggest to look at its documentation and maybe StackOverflow. This question seems relevant.

@PhilippWendler
Copy link
Member Author

Might be solved using the technique from #483?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants