From 84a920465570476baa8cd25400b0a3fc2ac18c26 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sat, 17 Aug 2019 14:40:28 +0200 Subject: [PATCH] reset fields only in case of success --- dist/static/js/httprint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/static/js/httprint.js b/dist/static/js/httprint.js index bdecee8..1dadef6 100644 --- a/dist/static/js/httprint.js +++ b/dist/static/js/httprint.js @@ -22,6 +22,8 @@ function uploadFile() { stack: 5, position: "top-center" }); + uploadField.value = null; + copies.value = 1; } else { $.toast({ text: reply.message || "unable to print file", @@ -34,7 +36,6 @@ function uploadFile() { position: "top-center" }); } - uploadField.value = null; }) .catch(function(err) { console.log(err); @@ -48,7 +49,6 @@ function uploadFile() { stack: 5, position: "top-center" }); - uploadField.value = null; }); }