[Rt-commit] rt branch, 4.2/jquery-update-fix, created. rt-4.2.1-69-gefc0706

? sunnavy sunnavy at bestpractical.com
Mon Dec 30 09:56:21 EST 2013


The branch, 4.2/jquery-update-fix has been created
        at  efc07069b93c68f2497a2b5d86ddfa5a6f5673ef (commit)

- Log -----------------------------------------------------------------
commit efc07069b93c68f2497a2b5d86ddfa5a6f5673ef
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Dec 28 09:45:23 2013 +0800

    fix js for new version of jquery(1.9.1) in RT 4.2
    
    * escape special chars for jquery selector
    * .attr => .prop
    
    see also #28127
    http://api.jquery.com/category/selectors/
    http://api.jquery.com/prop/

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index 8c9b304..890962b 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -91,8 +91,8 @@
     });
     jQuery(function() {
         jQuery("input[name=TxnSendMailTo]").change(function(ev) {
-            jQuery("input[name=TxnSendMailTo][value="+ev.target.value+"]")
-                  .attr("checked",jQuery(ev.target).attr('checked'));
+            var email = ev.target.value.replace(/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g, '\\$1');
+            jQuery("input[name=TxnSendMailTo][value="+email+"]").prop("checked",jQuery(ev.target).prop('checked'));
         });
     });
 </script>

-----------------------------------------------------------------------


More information about the rt-commit mailing list