Some fixes for the tree view

This commit is contained in:
Thomas Kluyver 2014-11-11 12:32:24 -08:00
parent f9db65ab6f
commit e453b160b1
2 changed files with 3 additions and 6 deletions

View File

@ -110,11 +110,8 @@ define([
});
});
this.element.find('#open_notebook').click(function () {
window.open(utils.url_join_encode(
that.notebook.base_url,
'tree',
that.notebook.notebook_path
));
var parent = utils.url_path_split(that.notebook.notebook_path)[0];
window.open(utils.url_join_encode(that.base_url, 'tree', parent));
});
this.element.find('#copy_notebook').click(function () {
that.notebook.copy_notebook();

View File

@ -38,7 +38,7 @@ class TreeHandler(IPythonHandler):
cm = self.contents_manager
if cm.file_exists(path):
# it's not a directory, we have redirecting to do
model = cm.get(path, content=False)
model = cm.get_model(path, content=False)
# redirect to /api/notebooks if it's a notebook, otherwise /api/files
service = 'notebooks' if model['type'] == 'notebook' else 'files'
url = url_escape(url_path_join(