Skip to content

Commit

Permalink
Merge pull request #3411 from takluyver/notebooklist-back-to-start
Browse files Browse the repository at this point in the history
Fix going back to root directory with history in notebook list
  • Loading branch information
takluyver authored Mar 15, 2018
2 parents 7fb0510 + 0c28482 commit 276474a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ define([
this.sessions = {};
this.base_url = options.base_url || utils.get_body_data("baseUrl");
this.notebook_path = options.notebook_path || utils.get_body_data("notebookPath");
this.initial_notebook_path = this.notebook_path;
this.contents = options.contents;
if (this.session_list && this.session_list.events) {
this.session_list.events.on('sessions_loaded.Dashboard',
Expand Down Expand Up @@ -351,7 +352,8 @@ define([
var that = this;
// Add an event handler browser back and forward events
window.onpopstate = function(e) {
var path = window.history.state ? window.history.state.path : '';
var path = (window.history.state && window.history.state.path) ?
window.history.state.path : that.initial_notebook_path;
that.update_location(path);
};
var breadcrumb = $('.breadcrumb');
Expand Down

0 comments on commit 276474a

Please sign in to comment.