From 73ed2e5751a68912ee30daee74661083648549d7 Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Tue, 31 Jul 2018 12:59:24 -0500
Subject: [PATCH] Reset Button Fix:

This commit makes sure that when the Reset button is hit, we only reset File Upload Field attachments for the specific form we're on.

Ex: Viewing a Ticket as an Agent and switching between 'Post Reply' and 'Post Internal Note'. If you had an image in the Post Reply file upload but switched to Post Internal Note and hit Reset, only the text/attachments on the Post Internal Note tab would be cleared.

(Improves upon #4369)
---
 js/redactor-osticket.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js
index da4b1c203..a81796412 100644
--- a/js/redactor-osticket.js
+++ b/js/redactor-osticket.js
@@ -291,7 +291,7 @@ $(function() {
         var reset = $('input[type=reset]', el.closest('form'));
         if (reset) {
             reset.click(function() {
-                var file = $('.file');
+                var file = $('.file', el.closest('form'));
                 if (file)
                     file.remove();
                 if (el.attr('data-draft-id'))
-- 
GitLab