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

Open
PhilippWendler opened this Issue Jan 14, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@PhilippWendler
Copy link
Member

PhilippWendler commented Jan 14, 2016

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

This comment has been minimized.

Copy link
Member

kfriedberger commented Jan 14, 2016

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

This comment has been minimized.

Copy link
Member Author

PhilippWendler commented Jan 14, 2016

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

This comment has been minimized.

Copy link
Member Author

PhilippWendler commented Jan 14, 2016

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

This comment has been minimized.

Copy link

kalpit4088 commented Mar 2, 2018

@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

This comment has been minimized.

Copy link
Member Author

PhilippWendler commented Mar 3, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.