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

? sunnavy sunnavy at bestpractical.com
Fri Dec 27 21:09:47 EST 2013


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

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

    fix js for new version of jquery in RT 4.2
    
    * escape special chars for jquery selector
    * .prop => .attr
    
    see also #28127, http://api.jquery.com/category/selectors/ and
    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