From d21258bbcceebf1aacdcd47fc103e8995c1016ba Mon Sep 17 00:00:00 2001 From: "Brian E. Granger" Date: Wed, 29 Jan 2014 15:53:20 -0800 Subject: [PATCH] Reset file upload form after an upload. --- IPython/html/static/tree/js/notebooklist.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js index e08e94952..cc2f7fba8 100644 --- a/IPython/html/static/tree/js/notebooklist.js +++ b/IPython/html/static/tree/js/notebooklist.js @@ -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; };