mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Use event.preventDefault() on links creating new files & folders
This commit is contained in:
parent
1d84d839f3
commit
51acfb61ad
@ -73,7 +73,7 @@ define([
|
||||
this.events.trigger('kernelspecs_loaded.KernelSpec', data.kernelspecs);
|
||||
};
|
||||
|
||||
NewNotebookWidget.prototype.new_notebook = function (kernel_name) {
|
||||
NewNotebookWidget.prototype.new_notebook = function (kernel_name, evt) {
|
||||
/** create and open a new notebook */
|
||||
var that = this;
|
||||
kernel_name = kernel_name || this.default_kernel;
|
||||
@ -107,6 +107,9 @@ define([
|
||||
}
|
||||
});
|
||||
});
|
||||
if (evt !== undefined) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
};
|
||||
|
||||
return {'NewNotebookWidget': NewNotebookWidget};
|
||||
|
@ -169,6 +169,7 @@ define([
|
||||
console.warn('Error during New file creation', e);
|
||||
});
|
||||
that.load_sessions();
|
||||
e.preventDefault();
|
||||
});
|
||||
$('#new-folder').click(function(e) {
|
||||
that.contents.new_untitled(that.notebook_path || '', {type: 'directory'})
|
||||
@ -189,6 +190,7 @@ define([
|
||||
console.warn('Error during New directory creation', e);
|
||||
});
|
||||
that.load_sessions();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Bind events for action buttons.
|
||||
@ -373,8 +375,8 @@ define([
|
||||
breadcrumb.append(root);
|
||||
var path_parts = [];
|
||||
this.notebook_path.split('/').forEach(function(path_part) {
|
||||
path_parts.push(path_part)
|
||||
var path = path_parts.join('/')
|
||||
path_parts.push(path_part);
|
||||
var path = path_parts.join('/');
|
||||
var url = utils.url_path_join(
|
||||
that.base_url,
|
||||
'/tree',
|
||||
|
Loading…
Reference in New Issue
Block a user