incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#5749] bind to future click events; cleaner radio finding logic
Date Thu, 02 Jan 2014 18:57:42 GMT
Updated Branches:
  refs/heads/db/5749 bc79de51f -> b228e6924


[#5749] bind to future click events; cleaner radio finding logic


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b228e692
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b228e692
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b228e692

Branch: refs/heads/db/5749
Commit: b228e69249197202d196d102b1589f70d01b47c9
Parents: bc79de5
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Jan 2 13:57:34 2014 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Jan 2 13:57:34 2014 -0500

----------------------------------------------------------------------
 .../forgetracker/templates/tracker/admin_fields.html   | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b228e692/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
index 36b357b..1d09e3c 100644
--- a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
+++ b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
@@ -62,18 +62,11 @@
 {% block extra_js %}
 <script type="text/javascript">
     $(document).ready(function () {
-        $(":radio.default-milestone").click(function(){
+        $(document).on('click', ":radio.default-milestone", function(){
             // page can contain more that one milestone field,
             // so we should touch only radio buttons corresponding to given field
-            var name_prefix = $(this).attr("name").match(/custom_fields-\d+/)[0];
-            var all_radios = $(":radio.default-milestone");
-            var radios = all_radios.filter(function(radio) {
-                if (this.name.slice(0, name_prefix.length) == name_prefix) {
-                    return true;
-                }
-                return false;
-            });
-            radios.attr("checked", false);
+            var parent_table = $(this).closest('table');
+            $(":radio.default-milestone", parent_table).attr("checked", false);
             $(this).attr("checked", true);
         });
     });


Mime
View raw message