incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [09/37] git commit: [#5749] ticket:504 Separate radio button groups from each other
Date Mon, 16 Dec 2013 22:16:09 GMT
[#5749] ticket:504 Separate radio button groups from each other


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

Branch: refs/heads/db/5424
Commit: 1ba6c8d4065a6667ee27d1fb7155800eaee96a82
Parents: c09bb8f
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Dec 16 14:00:40 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Dec 16 17:28:01 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/templates/tracker/admin_fields.html    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1ba6c8d4/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 88bffb8..36b357b 100644
--- a/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
+++ b/ForgeTracker/forgetracker/templates/tracker/admin_fields.html
@@ -63,7 +63,17 @@
 <script type="text/javascript">
     $(document).ready(function () {
         $(":radio.default-milestone").click(function(){
-            $(":radio.default-milestone").attr("checked", false);
+            // 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);
             $(this).attr("checked", true);
         });
     });


Mime
View raw message