mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-13 13:17:50 +08:00
Merge pull request #4950 from ellisonbg/file-upload
Two fixes for file upload related bugs closes #4825 closes #4871
This commit is contained in:
commit
6e13b2d2b8
@ -92,6 +92,11 @@ var IPython = (function (IPython) {
|
||||
});
|
||||
}
|
||||
}
|
||||
// Replace the file input form wth a clone of itself. This is required to
|
||||
// reset the form. Otherwise, if you upload a file, delete it and try to
|
||||
// upload it again, the changed event won't fire.
|
||||
var form = $('input.fileinput');
|
||||
form.replaceWith(form.clone(true));
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -318,6 +323,7 @@ var IPython = (function (IPython) {
|
||||
.addClass('btn btn-primary btn-mini upload_button')
|
||||
.click(function (e) {
|
||||
var nbname = item.find('.item_name > input').val();
|
||||
var path = that.notebookPath();
|
||||
var nbdata = item.data('nbdata');
|
||||
var content_type = 'application/json';
|
||||
var model = {
|
||||
@ -331,7 +337,7 @@ var IPython = (function (IPython) {
|
||||
data : JSON.stringify(model),
|
||||
headers : {'Content-Type': content_type},
|
||||
success : function (data, status, xhr) {
|
||||
that.add_link(data, nbname, item);
|
||||
that.add_link(path, nbname, item);
|
||||
that.add_delete_button(item);
|
||||
},
|
||||
error : function (data, status, xhr) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user