Skip to content

Commit 1d84d83

Browse files
committed
Change the path to create notebooks in when navigating directories
Closes jupytergh-3263 Closes jupytergh-3248
1 parent 8441005 commit 1d84d83

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

notebook/static/tree/js/newnotebook.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ define([
1313
var NewNotebookWidget = function (selector, options) {
1414
this.selector = selector;
1515
this.base_url = options.base_url;
16-
this.notebook_path = options.notebook_path;
1716
this.contents = options.contents;
1817
this.events = options.events;
1918
this.default_kernel = null;
@@ -79,7 +78,8 @@ define([
7978
var that = this;
8079
kernel_name = kernel_name || this.default_kernel;
8180
var w = window.open(undefined, IPython._target);
82-
this.contents.new_untitled(that.notebook_path, {type: "notebook"}).then(
81+
var dir_path = $('body').attr('data-notebook-path');
82+
this.contents.new_untitled(dir_path, {type: "notebook"}).then(
8383
function (data) {
8484
var url = utils.url_path_join(
8585
that.base_url, 'notebooks',

notebook/static/tree/js/notebooklist.js

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ define([
399399

400400
NotebookList.prototype.update_location = function (path) {
401401
this.notebook_path = path;
402+
$('body').attr('data-notebook-path', path);
402403
// Update the file tree list without reloading the page
403404
this.load_list();
404405
};

0 commit comments

Comments
 (0)