From 1f0f07bbb4e5a5b1cc37428e8b33897fddf279aa Mon Sep 17 00:00:00 2001 From: Maciej Tronowski Date: Tue, 21 Apr 2015 11:22:41 +0200 Subject: [PATCH] reset modal forms --- filex/static/filex/filex.js | 2 ++ qcg/templates/qcg/gridftp.html | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/filex/static/filex/filex.js b/filex/static/filex/filex.js index 6785d74..eb71ee4 100644 --- a/filex/static/filex/filex.js +++ b/filex/static/filex/filex.js @@ -264,11 +264,13 @@ $(function(){ parts = input.split('/'), callback_called = false; + $form[0].reset(); $form.find('#id_host').val(parts.shift()); if (parts.length) $form.find('#id_path').val(parts.join('/')); + $form.off(); $form.on('submit', function(e) { var $this = $(this), $btn = $this.find('[type="submit"]'); diff --git a/qcg/templates/qcg/gridftp.html b/qcg/templates/qcg/gridftp.html index 0b0d55a..9eb5cee 100644 --- a/qcg/templates/qcg/gridftp.html +++ b/qcg/templates/qcg/gridftp.html @@ -87,6 +87,11 @@ } }); + $('form').on('show.bs.modal', function() { + console.log('reset'); + this.reset(); + }); + $('#btn-upload').on('click', function() { var url = '{% url 'gridftp_upload' %}?' + $.param({host: filex.host, path: filex.path.full()}); -- 1.7.9.5